[Demonstration 1]

[Buggy Method]
@Test
public void testOneHostDefaultShardsReaderConfigurations() throws Exception {
    pushToGcs(DEPOSIT_1_HOST);
    assertReaderConfigurations(Optional.absent(), 0, 0, 100);
}

[Buggy Hunk]
assertReaderConfigurations(Optional.absent(), 0, 0, 100);

[Patch]
assertReaderConfigurations(Optional.<Integer>absent(), 0, 0, 100);

[Demonstration 2]

[Buggy Method]
private static void processRule1(String files1, String file2) throws MixException {
    File file = new File(file1);
    FileReader in = new FileReader(file);
    FileWriter out = new FileWriter(file.getName() + "mix");
    int c;
    while ((c = in.read()) != -1) {
        out.write(c);
        in.close();
        out.close();
    }
}

[Buggy Hunk]
private static void processRule1(String files1, String file2) throws MixException {

[Patch]
private static void processRule1(String file1, String file2) throws MixException {

[Demonstration 3]

[Buggy Method]
public long recursiveScan(File file, DiskNode treeNode) {
    if (!scanning)
        return 0;
    //System.out.println(file.getAbsoluteFile());
    if (counter > 100) {
        counter = 0;
        refreshStatus();
    }
    counter++;
    if (file.isDirectory()) {
        long total_size = 0;
        String[] subDirs = file.list();
        if (subDirs == null) {
            return total_size;
        }
        ;
        for (String filename : subDirs) {
            File newFile = new File(file, filename);
            DiskNode newNode = new DiskNode(filename, "", treeNode, newFile.getAbsoluteFile().toString());
            treeNode.getChildren().add(newNode);
            long my_size = recursiveScan(newFile, newNode);
            newNode.setDescription(DiskSizeUtil.humanReadableSize(my_size));
            newNode.setSize(my_size);
            total_size += my_size;
        }
        Collections.sort(treeNode.getChildren(), new NodeComparator());
        return total_size;
    } else {
        DuplicateFinder.getInstance().insert(new FileInfo(file.length(), file.lastModified()), file.getAbsolutePath());
        totalSize += file.length();
        return file.length();
    }
}

[Buggy Hunk]
DuplicateFinder.getInstance().insert(new FileInfo(file.length(),file.lastModified()),file.getAbsolutePath());

[Patch]
DuplicateFinder.getInstance().insert(new FileInfo(file.length()),file.getAbsolutePath());