[Demonstration 1]

[Buggy Method]
private String genElsePreCondition(LinkedList<String> array) {
    StringBuilder sb = new StringBuilder();
    sb.append("requires ");
    for (String s : array) {
        sb.append("!(" + s + ")");
        if (array.getLast().equals(s)) {
            sb.append(" && ");
        }
    }
    sb.append("\n");
    return sb.toString();
}

[Buggy Hunk]
if(array.getLast().equals(s)){

[Patch]
if(!array.getLast().equals(s)){

[Demonstration 2]

[Buggy Method]
private List<Long> extractNodeRefs(VTDNav vn, Hashtable<Long, PolygonPoint> nodes) throws NavException, XPathEvalException {
    vn.push();
    List<Long> refs = new ArrayList<>();
    for (int j = NODE_REF_PATH.evalXPath(); j != -1; j = NODE_REF_PATH.evalXPath()) {
        long ref = Long.parseLong(vn.toString(j + 1));
        refs.add(ref);
        nodes.put(ref, DUMMY_POINT);
    }
    NODE_REF_PATH.resetXPath();
    vn.pop();
    return refs;
}

[Buggy Hunk]
nodes.put(ref, DUMMY_POINT);

[Patch]
nodes.put(ref, new PolygonPoint(0, 0));

[Demonstration 3]

[Buggy Method]
public String readLocationString(XMLStreamReader reader) throws XMLStreamException {
    boolean found = checkElementName(reader, "LocationString");
    if (!found)
        throw new XMLStreamException(ERROR_INVALID_ELT + reader.getName() + errorLocationString(reader));
    return reader.getElementText();
}

[Buggy Hunk]
return reader.getElementText();

[Patch]
return trimStringValue(reader.getElementText());