[Demonstration 1]

[Buggy Method]
@SuppressWarnings({ "WeakerAccess", "unused" })
public Game copy(boolean copyMessenger) {
    Game copy = new Game(this.poType, this.sightLimit);
    copy.seed = seed;
    copy.rnd = new Random();
    copy.currentMaze = currentMaze;
    copy.pills = (BitSet) pills.clone();
    copy.powerPills = (BitSet) powerPills.clone();
    copy.mazeIndex = mazeIndex;
    copy.levelCount = levelCount;
    copy.currentLevelTime = currentLevelTime;
    copy.totalTime = totalTime;
    copy.score = score;
    copy.ghostEatMultiplier = ghostEatMultiplier;
    copy.gameOver = gameOver;
    copy.timeOfLastGlobalReversal = timeOfLastGlobalReversal;
    copy.pacmanWasEaten = pacmanWasEaten;
    copy.pillWasEaten = pillWasEaten;
    copy.powerPillWasEaten = powerPillWasEaten;
    copy.pacman = pacman.copy();
    copy.ghostsPresent = ghostsPresent;
    copy.pillsPresent = pillsPresent;
    copy.powerPillsPresent = powerPillsPresent;
    copy.ghostsEaten = new EnumMap<>(GHOST.class);
    copy.ghosts = new EnumMap<>(GHOST.class);
    for (GHOST ghostType : GHOST.values()) {
        copy.ghosts.put(ghostType, ghosts.get(ghostType).copy());
        copy.ghostsEaten.put(ghostType, ghostsEaten.get(ghostType));
    }
    copy.po = this.po;
    copy.agent = this.agent;
    if (hasMessaging()) {
        copy.messenger = (copyMessenger) ? messenger.copy() : this.messenger;
    }
    return copy;
}

[Buggy Hunk]
copy.pacman = pacman.copy();

[Patch]
copy.internalPacman = internalPacman.copy();

[Demonstration 2]

[Buggy Method]
public static byte[] hexdecode(String hex) {
    if (hex == null || hex.equals("")) {
        return new byte[0];
    }
    char[] orig = hex.toCharArray();
    int len = orig.length;
    //Adjust odd-length
    if ((len & 1) == 1) {
        len++;
    }
    char[] hexc = new char[len];
    System.arraycopy(orig, 0, hexc, 0, orig.length);
    byte[] bytes = new byte[len / 2];
    for (int i = 0; i < len; i += 2) {
        bytes[i / 2] = (byte) ((Character.digit(hexc[i], 16) << 4) | Character.digit(hexc[i + 1], 16));
    }
    return bytes;
}

[Buggy Hunk]
if (hex == null || hex.equals("")) {

[Patch]
if (isBlank(hex)) {

[Demonstration 3]

[Buggy Method]
public static void main(String[] args) {
    // -1 == or
    // -2 == and
    // -3 == neg
    //int elementsCount = 4;
    //int[] formula = {0,-2,1,-1,2,-2,-3,3};
    //int elementsCount = 2;
    //int[] formula = {0,-2,-3,0,-2,1};
    int elementsCount = 2;
    //{{-3, 0, -2, 1}, {-1}, {2, -2, -3, 3, -2, 0}, {-1}, {1, -2, 2}};
    int[][] formula = { { 1, 0 }, { 1 } };
    //int elementsCount = 2;
    //int[] formula = {-3, 0,-1,0,-2,1};
    int prevResult = -1;
    int isTrue = 0;
    int countOfPossibleCombinations = 1;
    for (int i = 0; i < elementsCount; i++) countOfPossibleCombinations *= 2;
    for (int combination = 0; combination < countOfPossibleCombinations; combination++) {
        //System.out.println("Testing combination " + Integer.toBinaryString(combination));
        prevResult = -1;
        for (int i = 0; i < formula.length - 1; i += 2) {
            int moduloAdd = 0;
            int partResult;
            int nextResult;
            if (prevResult == -1 && formula[i].length > 1) {
                partResult = solve(formula[i], combination);
            } else {
                if (prevResult == -1) {
                    if (formula[i][0] == -3) {
                        partResult = (getElementOnIPosition(formula[i + 1][0], combination) + 1) % 2;
                        i += 1;
                    } else {
                        partResult = getElementOnIPosition(formula[i][0], combination);
                    }
                } else {
                    partResult = prevResult;
                }
            }
            if (formula[i + 2][0] == -3 && formula[i + 2].length == 1) {
                moduloAdd = 1;
            }
            if (formula[i + 2 + moduloAdd].length > 1) {
                nextResult = (solve(formula[i + 2 + moduloAdd], combination) + moduloAdd) % 2;
            } else {
                nextResult = (getElementOnIPosition(formula[i + 2 + moduloAdd][0], combination) + moduloAdd) % 2;
            }
            if (formula[i + 1][0] == -1) {
                if (partResult == 1 || nextResult == 1)
                    prevResult = 1;
                else
                    prevResult = 0;
            } else if (formula[i + 1][0] == -2) {
                if (partResult == 1 && nextResult == 1)
                    prevResult = 1;
                else
                    prevResult = 0;
            }
            i += moduloAdd;
        }
        if (prevResult == 1) {
            //System.out.println("----> SAT splnitelny pro " + Integer.toBinaryString(combination));
            isTrue = 1;
        }
    }
    //if(isTrue == 0) System.out.println("SAT nesplnitelny.");
}

[Buggy Hunk]
int[][] formula = {{1, 0},{1}}; //{{-3, 0, -2, 1}, {-1}, {2, -2, -3, 3, -2, 0}, {-1}, {1, -2, 2}};

[Patch]
int[][] formula = {{-3, 0, -2, 1}, {-1}, {2, -2, -3, 3, -2, 0}, {-1}, {1, -2, 2}};