[Demonstration 1]

[Buggy Method]
@Override
public ListenableFuture<ExpiringGraph> getDefaultGraph() {
    SettableFuture<ExpiringGraph> future = SettableFuture.create();
    try {
        lockDataset();
        Query query = QueryFactory.create("SELECT ?s ?p ?o WHERE {?s ?p ?o}");
        ListenableFuture<QueryExecutionResults> resultsFuture = processSparqlQuery(query);
        Futures.addCallback(resultsFuture, new FutureCallback<QueryExecutionResults>() {

            @Override
            public void onSuccess(QueryExecutionResults queryExecutionResults) {
                Model model = Converter.toModel(queryExecutionResults.getResultSet());
                future.set(new ExpiringGraph(model, new Date()));
            }

            @Override
            public void onFailure(Throwable throwable) {
                future.setException(throwable);
            }
        });
    } catch (Exception ex) {
        LOG.error("Could not read default (union) graph: {}", ex);
        future.setException(ex);
    } finally {
        unlockDataset();
    }
    return future;
}

[Buggy Hunk]
SettableFuture<ExpiringGraph> future = SettableFuture.create();

[Patch]
final SettableFuture<ExpiringGraph> future = SettableFuture.create();

[Demonstration 2]

[Buggy Method]
protected void onError(Throwable e) {
    onRxError(e);
    unsubscribe();
}

[Buggy Hunk]
protected void onError(Throwable e) {

[Patch]
private void onError(Throwable e) {

[Demonstration 3]

[Buggy Method]
public int getUserInList(String name, InetAddress addr) {
    for (User u : userList) {
        if (u.getName().equals(name) && u.getAddr().equals(addr)) {
            return userList.indexOf(u);
        }
    }
    return -1;
}

[Buggy Hunk]
public int getUserInList(String name, InetAddress addr){

[Patch]
public synchronized int getUserInList(String name, InetAddress addr){