[Demonstration 1]

[Buggy Method]
private int getOperationIndex(String operation) {
    return featureList.get(operation);
}

[Buggy Hunk]
private int getOperationIndex(String operation) {

[Patch]
private Integer getOperationIndex(String operation) {

[Demonstration 2]

[Buggy Method]
@Override
public void reduce(String key, Iterator<ConceptId> values, ReduceEmitter<String, Long> emitter) {
    LOG.debug("Reduce on " + key);
    HashSet<ConceptId> conceptIds = new HashSet<ConceptId>();
    while (values.hasNext()) {
        ConceptId current = values.next();
        conceptIds.add(current);
    }
    LOG.debug("Concepts: " + conceptIds);
    if (conceptIds.size() > 1) {
        // TODO: what if we fail here due to some read-write conflict?
        try (GraknGraph graph = Grakn.factory(Grakn.DEFAULT_URI, keyspace).getGraph()) {
            ConceptFixer.runResourceFix(graph, key, conceptIds);
        }
        emitter.emit(key, new Long(conceptIds.size() - 1));
    }
    // Check and maybe delete resource if it's not attached to anything
    if (this.deleteUnattached) {
        // TODO: what if we fail here due to some read-write conflict?
        try (GraknGraph graph = Grakn.factory(Grakn.DEFAULT_URI, keyspace).getGraph()) {
            Resource<?> res = graph.admin().getConcept(Schema.ConceptProperty.INDEX, key);
            if (res.ownerInstances().isEmpty() && res.relations().isEmpty()) {
                res.delete();
            }
        }
    }
}

[Buggy Hunk]
emitter.emit(key, new Long(conceptIds.size() - 1));

[Patch]
emitter.emit(key, (long) (conceptIds.size() - 1));

[Demonstration 3]

[Buggy Method]
public void setHome() {
    writeLineAndWaitOk(GcodeCommand.parse("M19").get());
}

[Buggy Hunk]
writeLineAndWaitOk(GcodeCommand.parse("M19").get());

[Patch]
senderThread.addCommand(GcodeCommand.parse("M19").get());