[Demonstration 1]

[Buggy Method]
public BasicAutomaton star() {
    BasicAutomaton opt = optional();
    for (State a : opt.getAcceptStates()) {
        opt.addTransition(new Transition(a, opt.start));
    }
    return opt.determinize();
}

[Buggy Hunk]
return opt.determinize();

[Patch]
return opt.postProcess();

[Demonstration 2]

[Buggy Method]
@Override
public boolean isOwner(VTNEntityType etype) {
    Entity ent = VTNEntityType.getGlobalEntity(etype);
    Optional<EntityOwnershipState> opt = entityOwnerService.getOwnershipState(ent);
    return (opt != null && opt.get().isOwner());
}

[Buggy Hunk]
return (opt != null && opt.get().isOwner());

[Patch]
return (opt.isPresent() && opt.get().isOwner());

[Demonstration 3]

[Buggy Method]
@Override
public boolean equals(Object o) {
    if (this == o)
        return true;
    if (o == null || getClass() != o.getClass())
        return false;
    Tag tag1 = (Tag) o;
    return Objects.equals(tag, tag1.tag);
}

[Buggy Hunk]
return Objects.equals(tag, tag1.tag);

[Patch]
return Objects.equals(tagName, tag1.tagName);