[Demonstration 1]

[Buggy Method]
@Test
public void testSetDisplayNameZeroLength() throws Exception {
    // create a mock stapler request that returns a ""
    StaplerRequest req = Mockito.mock(StaplerRequest.class);
    Mockito.when(req.getParameter(DISPLAY_NAME_PARAMETER_NAME)).thenReturn("");
    StubJob j = new StubJob();
    // call setDisplayNameFromRequest
    j.setDisplayNameFromRequest(req);
    // make sure the getDisplayName returns the project name
    Assert.assertEquals(DEFAULT_STUB_JOB_NAME, j.getDisplayName());
}

[Buggy Hunk]
Assert.assertEquals(DEFAULT_STUB_JOB_NAME, j.getDisplayName());

[Patch]
Assert.assertEquals(StubJob.DEFAULT_STUB_JOB_NAME, j.getDisplayName());

[Demonstration 2]

[Buggy Method]
private static boolean fieldIsPresent(Collection<Protocol> protocols, String fieldName) {
    if (protocols.isEmpty()) {
        return false;
    }
    for (Protocol protocol : protocols) {
        if (protocol.getName().equals(fieldName)) {
            if (protocol.getDescription().length() > 3) {
                return true;
            }
        }
    }
    return false;
}

[Buggy Hunk]
if (protocol.getName().equals(fieldName)) {

[Patch]
if (protocol.getName().equalsIgnoreCase(fieldName)) {

[Demonstration 3]

[Buggy Method]
public final List<ContractOption> getIncompatibleOptions() {
    return incompatibleOptions;
}

[Buggy Hunk]
public final List<ContractOption> getIncompatibleOptions() {

[Patch]
public final Set<ContractOption> getIncompatibleOptions() {