[Demonstration 1]

[Buggy Method]
public void update(double current, double next) {
    currBearing = current;
    nextBearing = next;
    // Force redraw.
    invalidate();
}

[Buggy Hunk]
nextBearing = next;

[Patch]
nextBearing = next + Math.PI/2;

[Demonstration 2]

[Buggy Method]
@Override
public void addArgument(Argument arg) {
    checkArgument(arg != null, "Cannot add a null argument.");
    args.add(arg);
}

[Buggy Hunk]
args.add(arg);

[Patch]
args.addNode(arg);

[Demonstration 3]

[Buggy Method]
private List<String> getCommandArguments() {
    List<String> args = new ArrayList<String>();
    if (getOutputDirectory() != null) {
        args.add("-o");
        args.add(outputDirectory.getAbsolutePath());
    }
    // Where do we want ANTLR to look for .tokens and import grammars?
    if (getLibDirectory() != null && getLibDirectory().isDirectory()) {
        args.add("-lib");
        args.add(libDirectory.getAbsolutePath());
    }
    // Next we need to set the options given to us in the pom into the
    // tool instance we have created.
    if (atn) {
        args.add("-atn");
    }
    if (inputEncoding != null && !inputEncoding.isEmpty()) {
        args.add("-encoding");
        outputEncoding = inputEncoding;
        args.add(inputEncoding);
    }
    if (listener) {
        args.add("-listener");
    } else {
        args.add("-no-listener");
    }
    if (visitor) {
        args.add("-visitor");
    } else {
        args.add("-no-visitor");
    }
    if (treatWarningsAsErrors) {
        args.add("-Werror");
    }
    if (forceATN) {
        args.add("-Xforce-atn");
    }
    if (options != null) {
        for (Map.Entry<String, String> option : options.entrySet()) {
            args.add(String.format("-D%s=%s", option.getKey(), option.getValue()));
        }
    }
    if (arguments != null) {
        args.addAll(arguments);
    }
    return args;
}

[Buggy Hunk]
args.add(outputDirectory.getAbsolutePath());

[Patch]
args.add(getToolOutputDirectory().getAbsolutePath());