[Demonstration 1]

[Buggy Method]
public int addCallsFromFiles() throws Exception {
    File dir = new File(risLogsFolderPath);
    File[] files = dir.listFiles(new FilenameFilter() {

        @Override
        public boolean accept(File dir, String name) {
            if (name.endsWith(".log")) {
                return true;
            }
            return false;
        }
    });
    Pattern pattern = Pattern.compile(regexp);
    for (File file : files) {
        logger.info("Trying to parse regexp in log file " + file.getAbsolutePath());
        FileReader fileReader = null;
        try {
            fileReader = new FileReader(file);
            BufferedReader bufferedReader = new BufferedReader(fileReader);
            String buffer;
            while ((buffer = bufferedReader.readLine()) != null) {
                if (buffer.length() > 200) {
                    if (buffer.contains("Request<INVITE>")) {
                        Matcher matcher = pattern.matcher(buffer.substring(200));
                        if (matcher.find()) {
                            String regexFoundString = matcher.group();
                            if (!completedCallsHashMap.containsKey(regexFoundString)) {
                                if (!callHashMap.containsKey(regexFoundString)) {
                                    logger.info("Call " + regexFoundString + " has been added to current calls DB");
                                }
                                callHashMap.putIfAbsent(matcher.group(), System.currentTimeMillis());
                            }
                        }
                    }
                }
            }
            callDB.commit();
        } catch (IOException e) {
            e.printStackTrace();
            logger.catching(e);
        } finally {
            try {
                fileReader.close();
            } catch (IOException e) {
                e.printStackTrace();
                logger.catching(e);
            }
        }
    }
    logger.info("Log files by path " + risLogsFolderPath + " have been observed");
    logger.info(callHashMap.size() + " calls currently stored in current calls DB and " + completedCallsHashMap.size() + " calls in completed calls DB");
    return callHashMap.size();
}

[Buggy Hunk]
callHashMap.putIfAbsent(matcher.group(), System.currentTimeMillis());

[Patch]
callHashMap.putIfAbsent(regexFoundString, System.currentTimeMillis());

[Demonstration 2]

[Buggy Method]
@Test
public void test_listCat() {
    List<String> l0 = CollectionHelper.listCat();
    assertEquals(0, l0.size());
    List<String> l1 = CollectionHelper.listCat(Arrays.asList("one", "two", "three"));
    assertEquals(3, l1.size());
    assertEquals("one", l1.get(0));
    assertEquals("two", l1.get(1));
    assertEquals("three", l1.get(2));
    List<String> l2 = CollectionHelper.listCat(Arrays.asList("one", "two", "three"), Arrays.asList(), Arrays.asList("four", "five"));
    assertEquals(5, l2.size());
    assertEquals("one", l2.get(0));
    assertEquals("two", l2.get(1));
    assertEquals("three", l2.get(2));
    assertEquals("four", l2.get(3));
    assertEquals("five", l2.get(4));
}

[Buggy Hunk]
List<String> l2 = CollectionHelper.listCat(Arrays.asList("one", "two", "three"), Arrays.asList(), Arrays.asList("four", "five"));

[Patch]
List<String> l2 = CollectionHelper.listCat(Arrays.asList("one", "two", "three"), Arrays.<String>asList(), Arrays.asList("four", "five"));

[Demonstration 3]

[Buggy Method]
public void outANotExpr(ANotExpr node) {
    if (typeTable.get(node).equals(BOOL))
        addType(node, BOOL);
    else {
        ErrorList.add("ERROR line " + lineAndPos.getLine(node) + " pos " + lineAndPos.getPos(node) + " : " + node.getExpr().toString() + ", is not of type " + BOOL + ".");
        addType(node, ERRORTYPE);
    }
}

[Buggy Hunk]
if(typeTable.get(node).equals(BOOL))

[Patch]
if(compareType(node, BOOL))