[Demonstration 1]

[Buggy Method]
@Test
public void should_able_create_an_order() throws Exception {
    List<Order> orders = new ArrayList<>();
    when(orderController.createOrder(anyObject())).thenAnswer(invocationOnMock -> {
        Map<String, Object> body = (HashMap) invocationOnMock.getArguments()[0];
        Map<String, String> orderData = (HashMap) body.get("data");
        Long userId = Long.parseLong(orderData.get("userId"));
        orders.add(new Order(new Date(), userId));
        return ImmutableMap.of("data", ImmutableMap.of("status", "OK"));
    });
    when(orderController.getAllOrders()).thenAnswer(invocationOnMock -> ImmutableMap.of("data", orders));
    mvc.perform(post("/orders").contentType(MediaType.APPLICATION_JSON_UTF8).content("{\"data\":{\"userId\":\"1\"}}")).andExpect(status().isOk()).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(jsonPath("$.data.status", is("OK")));
    mvc.perform(get("/orders")).andExpect(status().isOk()).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(jsonPath("$.data[0].userId", is(1))).andExpect(jsonPath("$.data[0].orderTime", notNullValue()));
}

[Buggy Hunk]
orders.add(new Order(new Date(), userId));

[Patch]
orders.add(new Order(new Date(), userId, new ArrayList()));

[Demonstration 2]

[Buggy Method]
public void cancel() {
    try {
        mmSocket.close();
    } catch (IOException e) {
    }
}

[Buggy Hunk]
} catch (IOException e) { }

[Patch]
} catch (IOException e) { e.printStackTrace(); }

[Demonstration 3]

[Buggy Method]
@Test
public void testGetPermutationStrongNameWithInvalidArguments2() throws ServletException {
    try {
        servlet.getPermutationStrongName(null, new HashSet<BindingProperty>());
        Assert.fail("Expected exception did not occur");
    } catch (IllegalArgumentException e) {
    }
}

[Buggy Hunk]
servlet.getPermutationStrongName(null, new HashSet<BindingProperty>());

[Patch]
servlet.getPermutationStrongName(null, null, new HashSet<BindingProperty>());