[Demonstration 1]

[Buggy Method]
public void tap(Vector3 screenPos, int count) {
    if (count == 2) {
        switch(state) {
            case VIEWING:
                startAiming();
                break;
            case AIMING:
                startViewing();
                break;
            default:
                break;
        }
    }
}

[Buggy Hunk]
if (count == 2) {

[Patch]
if (count == 1) {

[Demonstration 2]

[Buggy Method]
public boolean hasNext() {
    return start < array.size();
}

[Buggy Hunk]
return start < array.size();

[Patch]
return index < array.size();

[Demonstration 3]

[Buggy Method]
public static void quickSort(int[] array, int left, int right) {
    if (array == null || array.length == 0)
        return;
    if (left >= right)
        return;
    int middle = (left + right) / 2;
    int i = left, j = right;
    while (i < j) {
        while (array[i] < array[middle]) i++;
        while (array[j] > array[middle]) j--;
        if (i <= j) {
            int temp = array[i];
            array[i] = array[j];
            array[j] = temp;
            i++;
            j--;
        }
    }
    if (left < j)
        quickSort(array, left, j);
    if (right > i)
        quickSort(array, i, right);
}

[Buggy Hunk]
int middle = (left + right) / 2;

[Patch]
int middle = (left+right)/2+1;