[Demonstration 1]

[Buggy Method]
public static double[] createBoundingBox(double[][] input) {
    double[] result = new double[input[0].length * 2];
    for (int i = 0; i < input[0].length; i++) {
        result[i] = Double.MAX_VALUE;
    }
    for (int i = input[0].length; i < result.length; i++) {
        result[i] = Double.MIN_VALUE;
    }
    for (double[] coord : input) {
        for (int i = 0; i < coord.length; i++) {
            result[i] = Math.min(coord[i], result[i]);
            result[i + coord.length] = Math.max(coord[i], result[i + coord.length]);
        }
    }
    return result;
}

[Buggy Hunk]
result[i] = Double.MIN_VALUE;

[Patch]
result[i] = - Double.MAX_VALUE; // use negative Double.MAX_VALUE, Double.MIN_VALUE is NOT what you'd expect it to be!

[Demonstration 2]

[Buggy Method]
public void addDrawing(String drawingMessage) {
    String[] drawingInfo = drawingMessage.split(":");
    String[] coordinates = drawingInfo[3].split(" ");
    float width = Float.valueOf(drawingInfo[1]);
    int color = Integer.valueOf(drawingInfo[2]);
    int count = 0;
    Drawing drawing = new Drawing(width, color);
    for (String coordinate : coordinates) {
        System.out.println("coordinate" + coordinate);
        String[] cord = coordinate.split(",");
        float x = Float.valueOf(cord[0]);
        float y = Float.valueOf(cord[1]);
        if (count == 0)
            drawing.moveTo(x, y);
        else
            drawing.lineTo(x, y);
        count++;
    }
    synchronized (drawList) {
        drawList.add(drawing);
    }
}

[Buggy Hunk]
String[] coordinates = drawingInfo[3].split(" ");

[Patch]
String[] coordinates = drawingInfo[3].trim().split(" ");

[Demonstration 3]

[Buggy Method]
public String popback() {
    if (items.size() > 0) {
        items.remove(items.size() - 1);
        return items.get(items.size() - 1);
    } else {
        return "";
    }
}

[Buggy Hunk]
if (items.size() > 0) {

[Patch]
if (items.size() > 1) {