[Demonstration 1]

[Buggy Method]
public boolean balanceExceedsLimitBy(int amount) {
    return (balance - amount > limit);
}

[Buggy Hunk]
return (balance - amount > limit);

[Patch]
return (balance - amount >= limit); //rectified to resolve balance calculation

[Demonstration 2]

[Buggy Method]
public List<Token> Tokenize(PushbackInputStream in) throws IOException {
    List<Token> tokens = new ArrayList<>();
    State current = State.INITIAL;
    String lexeme = "";
    int line = 1, col = 0;
    int startLine = 1, startCol = 1;
    Boolean done = false;
    while (!done) {
        int i = in.read();
        col++;
        if (current == State.INITIAL) {
            startLine = line;
            startCol = col;
        }
        if (i == -1) {
            done = true;
            i = (int) '\n';
        }
        char caracter = (char) i;
        lexeme += caracter;
        State new_state = nextState(caracter, current);
        //System.out.println(new_state);
        if (new_state == State.LEXICAL_ERROR) {
            for (Token t : tokens) {
                System.out.println(t);
            }
            System.out.println(">>> Error lexico linea: " + line + ", posicion: " + col + ")");
            return tokens;
        }
        if (accept.contains(new_state)) {
            if (ignorelast.contains(new_state)) {
                in.unread((int) caracter);
                col--;
                lexeme = lexeme.substring(0, lexeme.length() - 1);
            }
            switch(new_state) {
                case IDENTIFIER_END:
                    Token.Type t = null;
                    if (keywords.contains(lexeme)) {
                        t = Token.Type.KEYWORD;
                    } else if (Token.operators.get(lexeme) != null) {
                        t = Token.Type.OPERATOR;
                    } else {
                        t = Token.Type.IDENTIFIER;
                    }
                    tokens.add(new Token(t, lexeme, startLine, startCol));
                    break;
                case INTEGER_END:
                    tokens.add(new Token(Token.Type.INTEGER, lexeme, startLine, startCol));
                    break;
                case DOUBLE_END:
                    tokens.add(new Token(Token.Type.DOUBLE, lexeme, startLine, startCol));
                    break;
                case STRING_END:
                    tokens.add(new Token(Token.Type.STRING, lexeme.substring(1, lexeme.length() - 1), startLine, startCol));
                    break;
                case SINGLE_TOKEN_END:
                case GREATER_END:
                case GREATER_EQUAL:
                case LESS_END:
                case LESS_EQUAL:
                case NOT_END:
                case NOT_EQUAL:
                case DOUBLE_STAR:
                case STAR_END:
                case AND_END:
                case EQUALS_END:
                case OR_END:
                    tokens.add(new Token(Token.Type.OPERATOR, lexeme, startLine, startCol));
                    break;
                case LINE_BREAK:
                    line++;
                    col = 0;
                    break;
                case IGNORE:
                    break;
            }
            lexeme = "";
            new_state = State.INITIAL;
        }
        current = new_state;
    }
    for (Token t : tokens) {
        System.out.println(t);
    }
    return tokens;
}

[Buggy Hunk]
System.out.println(">>> Error lexico linea: " + line + ", posicion: " + col + ")");

[Patch]
System.out.println(">>> Error lexico linea: " + line + ", posicion: " + (col==1?col:--col) + ")");

[Demonstration 3]

[Buggy Method]
private void createRootIndex(Path rootDir) throws Exception {
    List<String> buildsList = new ArrayList<String>();
    try (DirectoryStream<Path> stream = Files.newDirectoryStream(rootDir)) {
        for (Path entry : stream) {
            if (entry.toFile().isDirectory()) {
                String dir = entry.getName(entry.getNameCount() - 1).toString();
                System.out.println(dir);
                buildsList.add(dir);
            }
        }
    } catch (Exception ex) {
        System.err.println(ex.getMessage());
    }
    Collections.sort(buildsList, Collections.reverseOrder());
    VelocityContext context = createContext();
    context.put(BUILDS_LIST, buildsList);
    generateFile(rootDir.resolve(ROOT_INDEX_FILE).toFile(), ROOT_INDEX_FILE + TEMPLATE_EXTENSION, context);
}

[Buggy Hunk]
Collections.sort(buildsList, Collections.reverseOrder());

[Patch]
Collections.sort(buildsList, new ReverseOrder());