[Demonstration 1]

[Buggy Method]
public List<Source> addKeywords(ArrayList<Source> list) {
    ArrayList<Source> toRemove = new ArrayList<>();
    int count = 0;
    for (Source p : list) {
        StringBuilder strbuilder = new StringBuilder();
        p.getTexts().stream().forEach(strbuilder::append);
        ArrayList<String> toAnalyze = new ArrayList<>();
        //toAnalyze.add(toAnalyze.toString());
        toAnalyze.add(p.getTexts().get(0) + p.getTexts().get(1));
        try {
            if (keywordExtractor.extractKeywordsFromTexts(toAnalyze, Configurator.numKeywords).get(0) != null) {
                p.setKeywordList((ArrayList<Keyword>) keywordExtractor.extractKeywordsFromTexts(toAnalyze, Configurator.numKeywords).stream().flatMap(l -> l.stream()).collect(Collectors.toList()));
            } else {
                toRemove.add(p);
            }
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        if (count % 10 == 0)
            System.out.println("building dataset -> " + (Math.round((count * 100) / list.size())) + "%");
        count++;
    }
    System.out.println("building dataset -> " + (Math.round((count * 100) / list.size())) + "%");
    for (Source p : toRemove) {
        list.remove(p);
    }
    return list;
}

[Buggy Hunk]
toAnalyze.add(p.getTexts().get(0)+p.getTexts().get(1));

[Patch]
toAnalyze.add(p.getTexts().get(0)+" "+p.getTexts().get(1));

[Demonstration 2]

[Buggy Method]
public static UserCache getUserCache(Context ctxt) {
    return new BuiltinUserCache(ctxt);
}

[Buggy Hunk]
return new BuiltinUserCache(ctxt);

[Patch]
return BuiltinUserCache.getDatabase(ctxt);

[Demonstration 3]

[Buggy Method]
public static void main(String[] args) {
    long number = 600851475143L;
    long sqrt = Math.round(Math.sqrt(number));
    System.out.println(sqrt);
    ArrayList<Long> numbers = new ArrayList<Long>();
    for (long i = 2; i <= sqrt; i++) {
        numbers.add(i);
    }
    long p = 2;
    boolean run = true;
    boolean found = false;
    while (run) {
        for (long n = p; n < numbers.size() + 2; n = n + p) {
            if (n != p && n % p == 0) {
                numbers.set((int) (n - 2), -n);
            }
        }
        long oldPrime = p;
        found = false;
        for (long n : numbers) {
            if (n > p) {
                p = n;
                found = true;
                break;
            }
        }
        if (!found || oldPrime == p || p > sqrt) {
            run = false;
        }
        System.out.println("Prime" + p);
    }
    for (long n : numbers) {
        if (n > 0) {
            System.out.println("Prime" + n);
        }
    }
}

[Buggy Hunk]
ArrayList<Long> numbers = new ArrayList<Long>();

[Patch]
ArrayList<Long> numbers = new ArrayList<>();