[Demonstration 1]

[Buggy Method]
@Override
public boolean process(Set<? extends TypeElement> annoations, RoundEnvironment env) {
    //get all elements annotated with StatusInfo
    Collection<? extends Element> annotatedElements = env.getElementsAnnotatedWith(StatusInfo.class);
    //filter out elements we don't need
    List<TypeElement> types = new ImmutableList.Builder<TypeElement>().addAll(ElementFilter.typesIn(annotatedElements)).build();
    for (TypeElement type : types) {
        //interfaces are types too, but we only need classes
        //we need to check if the TypeElement is a valid class
        if (isValidClass(type)) {
            writeSourceFile(type);
        } else {
            return true;
        }
    }
    return true;
}

[Buggy Hunk]
public boolean process(Set<? extends TypeElement> annoations, RoundEnvironment env) {

[Patch]
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment env) {

[Demonstration 2]

[Buggy Method]
public static String extractEligibleGramFromPhoneGram(String phoneGram) {
    if (isBlank(phoneGram)) {
        return "";
    }
    if (GramBuilder.isUnaryGram(phoneGram)) {
        if (isPhoneEligibleAsPartial(phoneGram)) {
            return phoneGram;
        } else {
            return "";
        }
    }
    GramBuilder sb = new GramBuilder();
    for (String s : SPLITTER.split(phoneGram)) {
        if (isPhoneEligibleAsPartial(s)) {
            sb.append(s);
        }
    }
    return sb.toString();
}

[Buggy Hunk]
return sb.toString();

[Patch]
return sb.make();

[Demonstration 3]

[Buggy Method]
private long sum() {
    Set<Long> set = Sets.newTreeSet();
    pascal.goLowerRight();
    set.add(pascal.getCurrent());
    for (int n = 2; n < rows; ++n) {
        if ((n & 1) == 0) {
            // at left edge
            pascal.goLowerLeft();
            for (int k = n / 2; k > 0; --k) {
                set.add(pascal.getCurrent());
                pascal.goLeft();
            }
        } else {
            // in middle
            pascal.goLowerRight();
            for (int k = 1; k <= n / 2; ++k) {
                set.add(pascal.getCurrent());
                pascal.goRight();
            }
        }
    }
    return set.stream().filter(this::isSquareFree).mapToLong(Long::longValue).sum();
}

[Buggy Hunk]
Set<Long> set = Sets.newTreeSet();

[Patch]
Set<Long> set = Sets.newHashSet();