[Demonstration 1]

[Buggy Method]
public LinkedHashSet<Integer> getPostings(String term) {
    return index.get(term).getRight();
}

[Buggy Hunk]
return index.get(term).getRight();

[Patch]
return index.get(term).getPostings();

[Demonstration 2]

[Buggy Method]
private String consumeUsingStrategy(Object acceptable, ConsumeStrategy strategy, boolean beforeEnd, boolean returnAccepted) {
    AcceptableChars acceptableChars = null;
    char acceptChar = '\0';
    int acceptCount = 0;
    if (acceptable instanceof AcceptableChars) {
        if (strategy == ConsumeStrategy.COUNT) {
            throw new IllegalArgumentException("Passed AcceptableChars as acceptable but COUNT as strategy");
        }
        acceptableChars = (AcceptableChars) acceptable;
    } else if (acceptable instanceof Character) {
        if (strategy == ConsumeStrategy.COUNT) {
            throw new IllegalArgumentException("Passed character as acceptable but COUNT as strategy");
        }
        acceptChar = (char) acceptable;
    } else if (acceptable instanceof Integer) {
        if (strategy != ConsumeStrategy.COUNT) {
            throw new IllegalArgumentException("Passed integer as acceptable but not COUNT as strategy");
        }
        acceptCount = (int) acceptable;
        if (acceptCount < 1) {
            throw new IllegalArgumentException("Invalid count");
        }
    } else {
        throw new IllegalArgumentException("Invalid acceptable object");
    }
    int i = 0;
    while (true) {
        int nextIndex = lastAcceptedPos + i + 1;
        if (beforeEnd && nextIndex == code.length()) {
            break;
        }
        if (strategy == ConsumeStrategy.SINGLE && i == 1) {
            break;
        }
        // This still needs to be inside the loop as beforeEnd may be true
        if (strategy == ConsumeStrategy.COUNT) {
            if (i != acceptCount) {
                i++;
                continue;
            } else {
                break;
            }
        }
        char nextChar = charAt(nextIndex);
        boolean has;
        if (acceptableChars != null) {
            has = acceptableChars.has(nextChar);
        } else {
            has = acceptChar == nextChar;
        }
        if ((strategy == ConsumeStrategy.UNTIL || strategy == ConsumeStrategy.SINGLE) && has || strategy == ConsumeStrategy.GREEDY && !has) {
            break;
        }
        i++;
    }
    if (i == 0) {
        return "";
    }
    String accepted = null;
    if (returnAccepted) {
        accepted = code.substring(lastAcceptedPos + 1, lastAcceptedPos + 1 + i);
    }
    lastAcceptedPos += i;
    return accepted;
}

[Buggy Hunk]
if ((strategy == ConsumeStrategy.UNTIL || strategy == ConsumeStrategy.SINGLE) && has || strategy == ConsumeStrategy.GREEDY && !has) {

[Patch]
if (strategy == ConsumeStrategy.UNTIL && has || (strategy == ConsumeStrategy.GREEDY || strategy == ConsumeStrategy.SINGLE) && !has) {

[Demonstration 3]

[Buggy Method]
private String getPadNameFromInput(TextView input) {
    String padName = (String) input.getText().toString();
    return padName;
}

[Buggy Hunk]
String padName = (String) input.getText().toString();

[Patch]
String padName = (String) input.getText().toString().trim();