[Demonstration 1]

[Buggy Method]
@Override
public boolean equals(Object o) {
    if (o instanceof ImmutableRoaringArray) {
        final ImmutableRoaringArray srb = (ImmutableRoaringArray) o;
        return srb.buffer.equals(this.buffer);
    }
    if (o instanceof MutableRoaringArray) {
        final MutableRoaringArray srb = (MutableRoaringArray) o;
        MappeableContainerPointer cp1 = srb.getContainerPointer();
        MappeableContainerPointer cp2 = srb.getContainerPointer();
        while (cp1.hasContainer()) {
            if (!cp2.hasContainer())
                return false;
            if (cp1.key() != cp2.key())
                return false;
            if (cp1.getCardinality() != cp2.getCardinality())
                return false;
            if (!cp1.getContainer().equals(cp2.getContainer()))
                return false;
            cp1.advance();
            cp2.advance();
        }
        if (cp2.hasContainer())
            return false;
        return true;
    }
    return false;
}

[Buggy Hunk]
MappeableContainerPointer cp1 = srb.getContainerPointer();

[Patch]
MappeableContainerPointer cp1 = this.getContainerPointer();

[Demonstration 2]

[Buggy Method]
public int countMatch(int a, int b) {
    if (a <= 0 && b <= 0)
        return 0;
    else {
        if (a % 10 == b % 10)
            return 1 + countMatch(a / 10, b / 10);
    }
    return 0;
}

[Buggy Hunk]
if (a <= 0 && b <= 0) return 0;

[Patch]
if (a <= 0 || b <= 0) return 0;

[Demonstration 3]

[Buggy Method]
public static void fillInWeightedDVol(ArrayList<Metric> metricSequence, int weight) {
    // Initialize Variables
    float yesterdaysDVol = 0f;
    int c = 1;
    for (Metric metric : metricSequence) {
        float adjClose = metric.getAdjClose();
        float adjOpen = metric.getAdjOpen();
        float adjHigh = metric.getAdjHigh();
        float adjLow = metric.getAdjLow();
        float todaysAvg = (adjClose + adjOpen + adjHigh + adjLow) / 4f;
        float todaysRange = adjHigh - adjLow;
        float todaysDVol = todaysRange / todaysAvg * 100f;
        if (c > 1) {
            todaysDVol = ((todaysDVol * weight / 100f) + (yesterdaysDVol * (1 - (weight / 100f))));
        }
        // Set this day's DVOL value and add it to the new sequence
        if (c >= 10) {
            metric.value = todaysDVol;
        } else {
            metric.value = null;
        }
        metric.name = "dvol" + weight + "ema";
        yesterdaysDVol = todaysDVol;
        c++;
    }
}

[Buggy Hunk]
if (c >= 10) {

[Patch]
if (c >= (weight / 2)) {