[Demonstration 1]

[Buggy Method]
@Override
public Cursor<Img<LongType>> copyCursor() {
    return new Histograms<T>(integralHistogram, window);
}

[Buggy Hunk]
return new Histograms<T>(integralHistogram, window);

[Patch]
return new Histograms<T>(integralHistogram, radius);

[Demonstration 2]

[Buggy Method]
public static <T> Option query(T opt, int nth) {
    for (Option option : optionsParsed) {
        if (((opt instanceof Character && option.isSingle) || (opt instanceof String && !option.isSingle)) && option.flag.equals(opt)) {
            if (--nth > 0)
                continue;
            else
                return option;
        }
    }
    return null;
}

[Buggy Hunk]
&& option.flag.equals(opt))

[Patch]
&& option.flag.equals(opt + ""))

[Demonstration 3]

[Buggy Method]
private static void findAndPrintLineSegments(Point[] input) {
    Arrays.sort(input);
    int n = input.length;
    Point[] pointsSortedBySlope = Arrays.copyOf(input, n);
    for (int i = 0; i < n - 3; i++) {
        Point p = input[i];
        Arrays.sort(pointsSortedBySlope, p.SLOPE_ORDER);
        double prevSlope = Double.NEGATIVE_INFINITY;
        int sequenceStartIndex = 0;
        for (int j = 1; j < pointsSortedBySlope.length; j++) {
            double slope = p.slopeTo(pointsSortedBySlope[j]);
            if (prevSlope != slope) {
                // slope has changed -- draw the segment, if needed
                // reset trackers
                checkAndDrawLineSegment(p, pointsSortedBySlope, sequenceStartIndex, j - sequenceStartIndex);
                sequenceStartIndex = j;
                prevSlope = slope;
            }
        }
        checkAndDrawLineSegment(p, pointsSortedBySlope, sequenceStartIndex, n - sequenceStartIndex);
    }
}

[Buggy Hunk]
private static void findAndPrintLineSegments(Point[] input) {

[Patch]
static void findAndPrintLineSegments(Point[] input) {