[Demonstration 1]

[Buggy Method]
boolean matches(ItemStack stack) {
    if (op == null || subject == null) {
        return false;
    }
    Optional<Integer> val = subject.getValue(stack);
    return val.isPresent() && op.check(val.get(), target);
}

[Buggy Hunk]
return val.isPresent() && op.check(val.get(), target);

[Patch]
return op.check(val.orElse(0), target);

[Demonstration 2]

[Buggy Method]
public boolean accept(File pathname) {
    if (pathname.getPath().matches(this.filterRule)) {
        return true;
    } else {
        return false;
    }
}

[Buggy Hunk]
if (pathname.getPath().matches(this.filterRule)) {

[Patch]
if (pathname.getName().matches(this.filterRule)) {

[Demonstration 3]

[Buggy Method]
public OutputStream getOutput(String pathname, boolean append, int chunk_size) throws IOException {
    GridFile file = (GridFile) getFile(pathname, chunk_size);
    if (file.isDirectory()) {
        throw new FileNotFoundException("Cannot write to directory (" + pathname + ")");
    }
    if (!file.createNewFile())
        throw new IOException("creation of " + pathname + " failed");
    return new GridOutputStream(file, append, data, chunk_size);
}

[Buggy Hunk]
return new GridOutputStream(file, append, data, chunk_size);

[Patch]
return new GridOutputStream(file, append, data);