[Demonstration 1]

[Buggy Method]
private void testDelete(String name, UUID uuid) throws TestException {
    String response = null;
    try {
        printDivider();
        System.out.println("Deleting " + name + ", uuid: " + uuid.toString());
        Message message = new DeleteDocumentMessage(this.getAuthToken(), name, uuid, "Delete, please");
        response = this.sender.send(message, true).get(30, TimeUnit.SECONDS);
        if (response == null) {
            throw new TestException("Got null response from sender");
        } else {
            JSONObject object = new JSONObject(response);
            UUID result = UUID.fromString(object.getString("uuid"));
            if (uuid.compareTo(result) == 0) {
                System.out.println("Delete succeeded");
            } else {
                throw new TestException("Unexpected answer '" + object.getString("uuid") + "' (expected '" + uuid.toString() + "')");
            }
        }
    } catch (org.json.JSONException e) {
        System.out.println(response);
        throw new TestException(e);
    } catch (InterruptedException | IOException | ExecutionException | TimeoutException e) {
        e.printStackTrace();
        throw new TestException(e);
    }
}

[Buggy Hunk]
Message message = new DeleteDocumentMessage(this.getAuthToken(), name, uuid, "Delete, please");

[Patch]
DeleteDocumentMessage message = new DeleteDocumentMessage(this.getAuthToken(), name, uuid, "Delete, please");

[Demonstration 2]

[Buggy Method]
public static MatlabTreeBuildWalker parse(String str, Class<?> defaultParameterTypeOrInterface) {
    ANTLRInputStream input = new ANTLRInputStream(str);
    MatlabGrammarLexer lexer = new MatlabGrammarLexer(input);
    CommonTokenStream tokens = new CommonTokenStream(lexer);
    MatlabGrammarParser parser = new MatlabGrammarParser(tokens);
    ParseTree tree = parser.prog();
    ParseTreeWalker walker = new ParseTreeWalker();
    MatlabTreeBuildWalker ew = new MatlabTreeBuildWalker(defaultParameterTypeOrInterface);
    walker.walk(ew, tree);
    return ew;
}

[Buggy Hunk]
ANTLRInputStream input = new ANTLRInputStream(str);

[Patch]
ANTLRInputStream input = new ANTLRInputStream(replaceAll(str));