[Demonstration 1]

[Buggy Method]
@Override
public boolean equals(Object o) {
    if (this == o)
        return true;
    if (o == null || getClass() != o.getClass())
        return false;
    Category category = (Category) o;
    return id == category.id && name.equals(category.name);
}

[Buggy Hunk]
return id == category.id && name.equals(category.name);

[Patch]
return id.equals(category.id) && name.equals(category.name);

[Demonstration 2]

[Buggy Method]
private void aquireWrite() throws IOException {
    if (_writeLockStream != null) {
        Log.d(TAG, "write lock already set for that process, skip. SourceName:" + ownName + " lockName: " + lockName);
        return;
    }
    for (String sourceName : processSources) {
        this.aquireRead(sourceName);
    }
    File lockFile = getWriteLockFile();
    _writeLockStream = new FileInputStream(lockFile);
    _writeLockStream.getChannel().lock();
}

[Buggy Hunk]
_writeLockStream = new FileInputStream(lockFile);

[Patch]
_writeLockStream = new RandomAccessFile(lockFile, "rw");

[Demonstration 3]

[Buggy Method]
@Override
public WorkerThread runMaintenance() throws Exception {
    WorkerThread wt = new WorkerThread(StorageIf.WT_NAME) {

        @Override
        public void run() {
            int issues = 0;
            setProgress(0);
            try {
                SolrIndexer indexer = SolrIndexer.getInstance();
                LiteMessageIterator messages = new LiteMessageIterator(null, BlueboxMessage.State.NORMAL);
                while (messages.hasNext()) {
                    LiteMessage msg = messages.next();
                    if (!indexer.containsUid(msg.getIdentifier())) {
                        log.warn("Message not indexed " + msg.getIdentifier());
                        indexer.indexMail(retrieve(msg.getIdentifier()), true);
                        issues++;
                        setProgress(messages.getProgress());
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                setProgress(100);
                setStatus("Completed, with " + issues + " unindexed messages fixed");
            }
        }
    };
    return wt;
}

[Buggy Hunk]
indexer.indexMail(retrieve(msg.getIdentifier()), true);

[Patch]
indexer.indexMail(retrieve(msg.getIdentifier()), false);