[Demonstration 1]

[Buggy Method]
public static void main(String[] args) {
    Board test = new Board();
    ComputerPlayer one = new ComputerPlayer(new Hard());
    ComputerPlayer two = new ComputerPlayer(new Hard());
    Mark m = Mark.Black;
    while (!test.hasEnded()) {
        test.setField(one.determineMove(test, m), m);
        if (test.isWinner(m)) {
            System.out.println("one has won");
            System.out.println(test);
            System.exit(0);
        }
        test.setField(two.determineMove(test, m.other()), m.other());
        if (test.isWinner(m.other())) {
            System.out.println("two has won");
            System.out.println(test);
            System.exit(0);
        }
        System.out.println(test);
    }
}

[Buggy Hunk]
Mark m = Mark.Black;

[Patch]
Mark m = Mark.X;

[Demonstration 2]

[Buggy Method]
public static int includedNumbers(List<Integer[]> ranges) {
    Set<Integer> numbers = new HashSet<Integer>();
    List<Range> rangesList = new ArrayList<Range>();
    for (Integer[] range : ranges) {
        addRange(rangesList, range);
    }
    for (Range range : rangesList) {
        numbers.addAll(range.getNumbers());
    }
    return numbers.size();
}

[Buggy Hunk]
Set<Integer> numbers = new HashSet<Integer>();

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

[Demonstration 3]

[Buggy Method]
public static Result service(String ownerName, String projectName, String service, boolean isAdvertise) throws IOException, UnsupportedOperationException, ServletException {
    if (!isSupportedService(service)) {
        return forbidden(String.format("Unsupported service: '%s'", service));
    }
    Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
    if (project == null) {
        return notFound();
    }
    models.User user = UserApp.currentUser();
    if (!isAllowed(project, service)) {
        if (user.isAnonymous()) {
            return BasicAuthAction.unauthorized(response());
        } else {
            // If you want the Git client showing your custom message to
            // the user, the Content-Type should be exact "text/plain"
            // without any parameter. For more details, see the code at
            // https://github.com/git/git/commit/426e70d4a11ce3b4f70636d57c6a0ab16ae08a00#diff-eea0ad565ec5903a11b6023755d491cfR154
            response().setHeader("Content-Type", "text/plain");
            return forbidden(String.format("'%s' has no permission to '%s/%s'.", user.name, ownerName, projectName));
        }
    }
    if (isAdvertise) {
        return ok(RepositoryService.gitAdvertise(project, service, response()));
    } else {
        if (request().body().isMaxSizeExceeded()) {
            return status(REQUEST_ENTITY_TOO_LARGE);
        } else {
            user.visits(project);
            return ok(RepositoryService.gitRpc(project, service, request(), response()));
        }
    }
}

[Buggy Hunk]
user.name, ownerName, projectName));

[Patch]
user.loginId, ownerName, projectName));