[Demonstration 1]

[Buggy Method]
@Override
public synchronized void stop(final SimpleCallback callback) {
    if (ENABLE_LOG) {
        System.out.println(this + ": Stopping map. Has values:");
        final Set<K> keys = map.keySet();
        @SuppressWarnings({ "rawtypes", "unchecked" })
        final List<Comparable<? super Comparable<?>>> list = new ArrayList(keys);
        Collections.sort(list);
        for (final Object key : list) {
            System.out.println(key + " -> " + map.get(key));
        }
    }
    callback.onSuccess();
}

[Buggy Hunk]
System.out.println(this + ": Stopping map. Has values:");

[Patch]
System.out.println(this.getClass() + ": Stopping map. Has values:");

[Demonstration 2]

[Buggy Method]
public void stopServer() {
    if (server != null) {
        server.stop();
        btnStopServer.setDisable(true);
        btnStartServer.setDisable(true);
        server = null;
        return;
    }
}

[Buggy Hunk]
btnStartServer.setDisable(true);

[Patch]
btnStartServer.setDisable(false);

[Demonstration 3]

[Buggy Method]
private void lastBook(BookInfo bi) {
    lastBook = null;
    if (bi != null) {
        String k = bi.getDirInfo().getBookDir().getAbsolutePath();
        if (k != null) {
            BookInfo fbi = lastBooks.get(k);
            if (fbi != null) {
                lastBooks.remove(k);
                bi = fbi;
            }
            lastBooks.put(k, bi);
            lastBook = bi;
            int rem2 = lastBooks.size() - 15;
            if (rem2 > 0) {
                for (String key : lastBooks.keySet()) {
                    if (rem2 > 0) {
                        lastBooks.remove(key);
                    } else {
                        break;
                    }
                    rem2--;
                }
            }
        }
    }
}

[Buggy Hunk]
for (String key : lastBooks.keySet()) {

[Patch]
for (String key : new ArrayList<String>(lastBooks.keySet())) {