[Demonstration 1]

[Buggy Method]
public Route generateRoute() {
    //Initalizes the intersections
    List<Intersection> intersections = new ArrayList();
    Intersection initialIntersection = grid.getEdgeIntersections().get(random.nextInt(grid.getEdgeIntersections().size()));
    intersections.add(initialIntersection);
    //Moves the route until it gets off the grid
    CardinalDirection currentDirection = grid.getEdgeDirection(initialIntersection);
    Intersection currentIntersection = initialIntersection;
    int NSBlock = currentIntersection.getNSBlock();
    int EWBlock = currentIntersection.getEWBlock();
    while (true) {
        //Finds a move direction and sets the cardinal direction, if there is a turn an intersection is added
        MoveDirection moveDirection = DIR_SEED[random.nextInt(DIR_SEED.length)];
        switch(moveDirection) {
            case FORWARD:
                break;
            case LEFT:
                currentDirection = CardinalDirection.values()[currentDirection.index - 1 % 4];
                intersections.add(grid.getIntersection(NSBlock, EWBlock));
                break;
            case RIGHT:
                currentDirection = CardinalDirection.values()[currentDirection.index + 1 % 4];
                intersections.add(grid.getIntersection(NSBlock, EWBlock));
                break;
            case U_TURN:
                currentDirection = CardinalDirection.values()[currentDirection.index - 2 % 4];
                intersections.add(grid.getIntersection(NSBlock, EWBlock));
                break;
            default:
                throw new UnsupportedOperationException("Direction: " + moveDirection + " not supported");
        }
        //updates the block the route is on
        Intersection beforeMove = grid.getIntersection(NSBlock, EWBlock);
        switch(currentDirection) {
            case NORTH:
                NSBlock++;
                break;
            case EAST:
                EWBlock++;
                break;
            case SOUTH:
                NSBlock--;
                break;
            case WEST:
                EWBlock--;
                break;
        }
        //breaks if the current route is off the grid, adds the intersection the route was at before moving
        if (NSBlock < 0 || NSBlock >= grid.getNSBlockSize() || EWBlock < 0 || EWBlock >= grid.getEWBlockSize()) {
            intersections.add(beforeMove);
            break;
        }
    }
    return new Route(intersections);
}

[Buggy Hunk]
currentDirection = CardinalDirection.values()[currentDirection.index -1 % 4];

[Patch]
currentDirection = CardinalDirection.values()[(currentDirection.index -1 + 4) % 4];

[Demonstration 2]

[Buggy Method]
static private void jjCheckNAdd(int state) {
    if (jjrounds[state] != jjround) {
        jjstateSet[jjnewStateCnt++] = state;
        jjrounds[state] = jjround;
    }
}

[Buggy Hunk]
static private void jjCheckNAdd(int state)

[Patch]
private void jjCheckNAdd(int state)

[Demonstration 3]

[Buggy Method]
private int findHighCard(int[] valueAry, int size) {
    for (int i = size; i > 0; i--) if (valueAry[i] > 0)
        return i;
    return -1;
}

[Buggy Hunk]
for(int i = size; i > 0; i--)

[Patch]
for(int i = size - 1; i > 0; i--)