[Demonstration 1]

[Buggy Method]
private static void putBookInfoInDatabase(BookInfo bookInfo, DbEventType dbEventType) {
    if (bookInfo == null) {
        return;
    }
    Realm realm = Realm.getDefaultInstance();
    realm.beginTransaction();
    realm.copyToRealmOrUpdate(bookInfo);
    realm.commitTransaction();
    realm.close();
    MainTabbedActivity.getBus().post(new DbEvent(dbEventType, bookInfo.getIsbn()));
    Log.i(TAG, "Added BookInfo for ISBN: " + bookInfo.getIsbn());
}

[Buggy Hunk]
if (bookInfo == null){

[Patch]
if (bookInfo == null || bookInfo.getIsbn().equals("not found")) {

[Demonstration 2]

[Buggy Method]
public synchronized void clear() {
    timeElapsed = 0;
    //      neededTimeStep = 0.5;
    //      timeStep = 0.5;
    getPointMasses().clear();
}

[Buggy Hunk]
getPointMasses().clear();

[Patch]
pointMasses.clear();

[Demonstration 3]

[Buggy Method]
public static List<ScanResult> getResults(String sequence) {
    List<ScanResult> resultList = new ArrayList<ScanResult>();
    for (int i = 0; i < sequence.length(); i++) {
        for (int j = sequence.length(); j >= 0; j--) {
            String possibleSequence = sequence.substring(i, j);
            String taleSequence = Misc.getTaleSequence2DNASequence(possibleSequence);
            double rating = TALRater.getRating(taleSequence);
            ScanResult result = new ScanResult(taleSequence, i);
            result.setRating(rating);
            resultList.add(result);
        }
    }
    return resultList;
}

[Buggy Hunk]
for (int j = sequence.length(); j >= 0; j--) {

[Patch]
for (int j = sequence.length(); j > i; j--) {