[Demonstration 1]

[Buggy Method]
@When("^I change \"([^\"]*)\" into number \"([^\"]*)\"$")
public void I_change_settingName_into_number_value(String settingName, String value) throws Throwable {
    onView(withTagValue(withStringMatching(settingName))).perform().perform(clearText()).perform(click()).perform(typeText(value));
}

[Buggy Hunk]
onView(withTagValue(withStringMatching(settingName))).perform().perform(clearText()).perform(click()).perform(typeText(value));

[Patch]
onView(withTagValue(withStringMatching(settingName))).perform(clearText()).perform(click()).perform(typeText(value));

[Demonstration 2]

[Buggy Method]
@Override
public void validate(Company company, OFSErrors errors) throws Exception {
    Optional optionalCompany = companyRepository.getCompanyByName(company.getName());
    if (!optionalCompany.isPresent()) {
        errors.rejectValue("company.name.exists", "company.name", "Invalid company name. Company name already exists.");
    }
}

[Buggy Hunk]
if(!optionalCompany.isPresent()) {

[Patch]
if(optionalCompany.isPresent()) {

[Demonstration 3]

[Buggy Method]
@Test(groups = { "rest", "document" }, dataProvider = "paginateDocument", dataProviderClass = DocumentDataProvider.class)
public void shouldPaginateAllDocuments(String[] keys, String[] values) throws Exception {
    mockMvc.perform(get("/col/documents").headers(getHeaders()).param(keys[0], values[0]).param(keys[1], values[1])).andExpect(status().isOk()).andExpect(content().contentType(new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8")))).andExpect(jsonPath("$.total", is(12))).andExpect(jsonPath("$.elements", hasSize(2))).andExpect(jsonPath("$.elements[0].id", is(1))).andExpect(jsonPath("$.elements[1].id", is(2)));
}

[Buggy Hunk]
.andExpect(jsonPath("$.total", is(12)))

[Patch]
.andExpect(jsonPath("$.total", is(8)))