[Demonstration 1]

[Buggy Method]
@Test
public void modifyValidTourSucceeds() throws Exception {
    when(mockTourService.postTour("t3", "{}")).thenReturn(1);
    mockMvc.perform(post(BASE_URL + "/t3").contentType(MediaType.APPLICATION_JSON).content("{}")).andExpect(status().isOk()).andExpect(content().string("Rows Affected: 1"));
}

[Buggy Hunk]
.andExpect(status().isOk())

[Patch]
.andExpect(status().isAccepted())

[Demonstration 2]

[Buggy Method]
@Override
public void keyRelease(int keycode) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        SkinJobGlobals.getAndroidApplicationContext().getSystemService(InputMethodManager.class).dispatchKeyEventFromInputMethod(null, new KeyEvent(KeyEvent.ACTION_UP, keycode));
    } else {
        // TODO
    }
}

[Buggy Hunk]
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {

[Patch]
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {

[Demonstration 3]

[Buggy Method]
@Test
public void findUserEmail() throws Exception {
    User aUser = createAUser();
    assertThat(aUser).isNotNull();
    assertThat(aUser.getId()).isNotNull();
    assertThat(aUser.getEmail()).isNotNull();
    MvcResult result = mockMvc.perform(get("/users/search/email/" + aUser.getEmail())).andExpect(status().isOk()).andExpect(content().contentType(contentType)).andReturn();
    String contentAsString = result.getResponse().getContentAsString();
    assertThat(contentAsString).isNotNull();
    User actualUser = mapper.readValue(contentAsString, User.class);
    assertThat(actualUser).isNotNull();
    assertThat(actualUser.getEmail()).isEqualTo(aUser.getEmail());
}

[Buggy Hunk]
MvcResult result = mockMvc.perform(get("/users/search/email/" + aUser.getEmail()))

[Patch]
MvcResult result = mockMvc.perform(get("/users/search/email").param(User.EMAIL, emailAddress))