[Demonstration 1]

[Buggy Method]
public void refresh(CheckBox checkbox, int index) {
    Set<Object> modelValues = retrieveModelValues();
    checkbox.setChecked(modelValues.contains(areValuesDefined() ? checkbox.getText() : index));
}

[Buggy Hunk]
areValuesDefined() ? checkbox.getText() : index

[Patch]
!areValuesDefined() ? checkbox.getText() : index

[Demonstration 2]

[Buggy Method]
public Duration getDuration() {
    if (duration == null) {
        this.duration = Query.getTotalDuration(querySegmentSpec);
    }
    return duration;
}

[Buggy Hunk]
this.duration = Query.getTotalDuration(querySegmentSpec);

[Patch]
this.duration = Queries.getTotalDuration(querySegmentSpec);