[Demonstration 1]

[Buggy Method]
private void obtainStyledAttributes(AttributeSet attrs) {
    TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.RoundCornerTextView);
    shape = a.getInt(R.styleable.RoundCornerTextView_shape, RECTANGLE);
    mScaleType = a.getInt(R.styleable.RoundCornerTextView_scaleType, FIT_CENTER);
    mBackgroundFitType = a.getInt(R.styleable.RoundCornerTextView_backgroundFitType, BACK);
    stroke_colors = a.getColorStateList(R.styleable.RoundCornerTextView_strokeColor);
    solid_colors = a.getColorStateList(R.styleable.RoundCornerTextView_solidColor);
    stroke_width = a.getDimensionPixelSize(R.styleable.RoundCornerTextView_strokeWidth, 0);
    self_round_corner = a.getBoolean(R.styleable.RoundCornerTextView_selfRoundCorner, false);
    if (self_round_corner) {
        corner_radius = a.getDimensionPixelSize(R.styleable.RoundCornerTextView_radius, 0);
        radius_left_top = a.getDimensionPixelSize(R.styleable.RoundCornerTextView_radius_left_top, -1);
        if (radius_left_top < 0) {
            radius_left_top = corner_radius;
        }
        radius_right_top = a.getDimensionPixelSize(R.styleable.RoundCornerTextView_radius_right_top, -1);
        if (radius_right_top < 0) {
            radius_right_top = corner_radius;
        }
        radius_right_bottom = a.getDimensionPixelSize(R.styleable.RoundCornerTextView_radius_right_bottom, -1);
        if (radius_right_bottom < 0) {
            radius_right_bottom = corner_radius;
        }
        radius_left_bottom = a.getDimensionPixelSize(R.styleable.RoundCornerTextView_radius_left_bottom, -1);
        if (radius_left_bottom < 0) {
            radius_left_bottom = corner_radius;
        }
    }
    a.recycle();
    setStrokeColor(stroke_colors != null ? stroke_colors : ColorStateList.valueOf(getCurrentTextColor()));
    setSolidColor(solid_colors != null ? solid_colors : ColorStateList.valueOf(Color.TRANSPARENT));
    mDrawable = getBackground();
    configureBounds();
}

[Buggy Hunk]
corner_radius = a.getDimensionPixelSize(R.styleable.RoundCornerTextView_radius,0);

[Patch]
corner_radius = a.getDimensionPixelSize(R.styleable.RoundCornerTextView_selfRadius,0);

[Demonstration 2]

[Buggy Method]
@Test
public void testProcessRemovedChanges() throws Exception {
    testProcessCreatedChanges();
    // case 1
    aggregator.processRemovedChanges(leafYiid23, TOPO3);
    Assert.assertEquals(0, aggregator.getTopoStoreProvider().getTopologyStore(TOPO1).getUnderlayItems().size());
    Assert.assertEquals(2, aggregator.getTopoStoreProvider().getTopologyStore(TOPO2).getUnderlayItems().size());
    // no physical nodes in topology store TOPO3 (=get(2))
    Assert.assertEquals(0, aggregator.getTopoStoreProvider().getTopologyStore(TOPO3).getUnderlayItems().size());
    Assert.assertEquals(0, aggregator.getTopoStoreProvider().getTopologyStore(TOPO4).getUnderlayItems().size());
    Mockito.verify(mockManager, Mockito.times(2)).addOverlayItem((OverlayItem) Mockito.any());
    Mockito.verify(mockManager, Mockito.times(0)).removeOverlayItem((OverlayItem) Mockito.any());
    // one logical node has been updated
    Mockito.verify(mockManager, Mockito.times(2)).updateOverlayItem((OverlayItem) Mockito.any());
    // case 2
    aggregator.processRemovedChanges(leafYiid22, TOPO2);
    // one physical node left in topology store TOPO2 (=get(1))
    Assert.assertEquals(1, aggregator.getTopoStoreProvider().getTopologyStore(TOPO2).getUnderlayItems().size());
    Mockito.verify(mockManager, Mockito.times(2)).addOverlayItem((OverlayItem) Mockito.any());
    // one logical node has been removed
    Mockito.verify(mockManager, Mockito.times(1)).removeOverlayItem((OverlayItem) Mockito.any());
    Mockito.verify(mockManager, Mockito.times(2)).updateOverlayItem((OverlayItem) Mockito.any());
}

[Buggy Hunk]
Assert.assertEquals(0, aggregator.getTopoStoreProvider().getTopologyStore(TOPO4).getUnderlayItems().size());

[Patch]
Assert.assertEquals(1, aggregator.getTopoStoreProvider().getTopologyStore(TOPO4).getUnderlayItems().size());

[Demonstration 3]

[Buggy Method]
static public Set<Context> getEnrolmentMasterContexts(final Context context) {
    final Set<Context> result = Sets.newHashSet();
    final CurriculumAggregator aggregator = getRootAggregator(context);
    if (aggregator != null) {
        result.addAll(aggregator.getEnrolmentMasterContexts());
    }
    return result;
}

[Buggy Hunk]
final CurriculumAggregator aggregator = getRootAggregator(context);

[Patch]
final CurriculumAggregator aggregator = getAggregationRoot(context);