[Demonstration 1]

[Buggy Method]
private void INC(int operand) {
    accessMemory(operand, accessMemory(operand) + 1);
}

[Buggy Hunk]
accessMemory(operand, accessMemory(operand) + 1);

[Patch]
accessMemory(operand, (accessMemory(operand) + 1) & 0xFF);

[Demonstration 2]

[Buggy Method]
public MockRestServiceServer build() {
    if (this.ignoreExpectOrder) {
        // default is false
        builder.ignoreExpectOrder(true);
    }
    MockRestServiceServer server = this.builder.build();
    List<StubMapping> mappings = new ArrayList<>();
    for (String location : this.locations) {
        try {
            for (Resource resource : this.resolver.getResources(pattern(location))) {
                StubMapping mapping = mapping(resource);
                mappings.add(mapping);
            }
        } catch (IOException e) {
            throw new IllegalStateException("Cannot load resources for: " + location, e);
        }
    }
    if (this.ignoreExpectOrder) {
        Collections.sort(mappings, new StubMappingComparator());
    }
    for (StubMapping mapping : mappings) {
        ResponseActions expect = server.expect(requestTo(request(mapping.getRequest())));
        requestHeaders(expect, mapping.getRequest());
        expect.andRespond(response(mapping.getResponse()));
    }
    return server;
}

[Buggy Hunk]
builder.ignoreExpectOrder(true); // default is false

[Patch]
this.builder.ignoreExpectOrder(true); // default is false

[Demonstration 3]

[Buggy Method]
public static SpellWord create(int spellNum) {
    switch(spellNum) {
        case 1:
            return new Darkness();
        case 2:
            return new Silence();
    }
    return null;
}

[Buggy Hunk]
case 2: return new Silence();

[Patch]
case 2: return new Quiet();