[Demonstration 1]

[Buggy Method]
@SuppressWarnings("unchecked")
public void putValue(final String key, final String field, final String value, final long expire) {
    logger.info("putObject to redis data:" + key + field + value);
    redisTemplate.execute(new RedisCallback<String>() {

        @Override
        public String doInRedis(RedisConnection connection) throws DataAccessException {
            byte[] btyKey = redisTemplate.getStringSerializer().serialize(namespace + key);
            byte[] btyField = redisTemplate.getStringSerializer().serialize(field);
            byte[] btyValue = redisTemplate.getStringSerializer().serialize(value);
            connection.hSetNX(btyKey, btyField, btyValue);
            if (expire > 0)
                connection.expire(btyKey, expire);
            return null;
        }
    });
}

[Buggy Hunk]
connection.hSetNX(btyKey,btyField,btyValue);

[Patch]
connection.hSet(btyKey,btyField,btyValue);

[Demonstration 2]

[Buggy Method]
@RequestMapping(value = "/load", method = RequestMethod.GET)
@ResponseBody
public String loadFromJson() {
    try {
        service.loadMusicFromJson();
        return "Playlist successfully loaded";
    } catch (Exception e) {
        return "A problem occurred when uploading playlist";
    }
}

[Buggy Hunk]
return "A problem occurred when uploading playlist";

[Patch]
return String.format("A problem occurred when uploading playlist [%s]", e.getMessage());

[Demonstration 3]

[Buggy Method]
@Test
public void testSetTeam_running() throws IOException {
    HttpServletRequest request = createMockedRequest(ID1, ID1, true, "POST", "/setteam");
    HttpServletResponse response = createMockedResponse();
    //Set the game state to in progress
    TestUtil.setGameState(GameState.RUNNING);
    //Simulate that the user is authorized
    WebClient client = spy(new WebClient());
    doReturn(client).when(webServer).getUser(any());
    //Put the client in FAKETEAM
    doReturn("FAKETEAM").when(client).getTeam();
    servlet.setTeam(request, response);
    //The clients current team, FAKETEAM, should have been written
    verify(response.getWriter()).write("FAKETEAM");
}

[Buggy Hunk]
doReturn("FAKETEAM").when(client).getTeam();

[Patch]
when(client.getTeam()).thenReturn("FAKETEAM");