[Demonstration 1]

[Buggy Method]
@Override
public ImmutableSet<UserDto> getUsersDataInChat(String accessToken, UserId userId, ChatRoomId chatRoomId) {
    ChatRoom currentChatRoom = chatRoomRepository.findOne(chatRoomId.getChatRoomId());
    if (currentChatRoom == null) {
        throw new NullPointerException("Chat room with current id wasn't found");
    }
    User userById = userRepository.findOne(userId.getUserId());
    if (userById == null) {
        throw new NullPointerException("User with current id wasn't found");
    }
    Set<UserDto> usersDto = new HashSet<>();
    Set<User> users = currentChatRoom.getUsers();
    for (User user : users) {
        usersDto.add(new UserDto(user.getId(), user.getName(), user.getMail(), null));
    }
    return ImmutableSet.copyOf(usersDto);
}

[Buggy Hunk]
Set<UserDto> usersDto = new HashSet<>();

[Patch]
Set<UserDto> usersDto = new TreeSet<>();

[Demonstration 2]

[Buggy Method]
private void createSchedule() {
    // Get a list of all the games we still need to schedule
    List<Game> unfinished = new ArrayList<Game>();
    for (Game game : forecast.gamesMap.values()) {
        if (!game.getState().isRunning() && !game.getState().isComplete()) {
            unfinished.add(game);
        }
    }
    // Order the games according to urgency
    GamesScheduler.orderGames(unfinished);
    // Find the first available slot, and schedule game
    long timeStart = Utils.offsetDate().getTime() / 1000;
    while (unfinished.size() > 0) {
        // Find index and time of machine that comes available first
        long[] indexAndTime = getIndexAndTime();
        int machineId = (int) indexAndTime[0];
        timeStart = Math.max(timeStart, indexAndTime[1]);
        // Find first game we're able to run
        for (Game game : unfinished) {
            long timeEnd = getTimeEnd(game, timeStart);
            boolean gameRunnable = isRunnable(game, timeStart, timeEnd);
            if (gameRunnable) {
                addJob(game, machineId, timeStart, timeEnd);
                unfinished.remove(game);
                // Order the games according to urgency
                GamesScheduler.orderGames(unfinished);
                break;
            }
        }
        // Only need to check when games start or finish
        List<Long> times = forecast.getTimes(timeStart, null);
        if (times.isEmpty() || times.get(0) == timeStart) {
            timeStart += 1;
        } else {
            timeStart = times.get(0);
        }
    }
}

[Buggy Hunk]
List<Game> unfinished = new ArrayList<Game>();

[Patch]
List<Game> unfinished = new ArrayList<>();

[Demonstration 3]

[Buggy Method]
public void postData() {
    for (LecturerViewModel lecturer : this.lecturerData) {
        int responseCode = postSingle(lecturer);
        System.out.println("ResponseCode ist: " + responseCode);
    }
}

[Buggy Hunk]
int responseCode = postSingle( lecturer );

[Patch]
int responseCode = post( lecturer );