[Demonstration 1]

[Buggy Method]
private List<ComputationState<K, V>> getAllNonFinalStates(Collection<ComputationState<K, V>> states) {
    return states.stream().filter(c -> !isForwardingToFinalState(c)).collect(Collectors.toList());
}

[Buggy Hunk]
.filter(c -> ! isForwardingToFinalState(c))

[Patch]
.filter(c -> !c.isForwardingToFinalState())

[Demonstration 2]

[Buggy Method]
public void changeParamObject(Integer testID) {
    Test test = (Test) HibernateUtil.get(Test.class, testID, getCurrentSession());
    paramObject = test.getParamObject();
}

[Buggy Hunk]
Test test = (Test) HibernateUtil.get(Test.class, testID, getCurrentSession());

[Patch]
Test test = (Test) HibernateUtil.get(Test.class, testID);

[Demonstration 3]

[Buggy Method]
public void testHavePreviousLineCached() {
    FlowLayoutOptions layoutOptions = new FlowLayoutOptions();
    layoutOptions.itemsPerLine = 2;
    int contentAreaWidth = 10;
    CacheHelper cacheHelper = new CacheHelper(layoutOptions, contentAreaWidth);
    Point[] items = new Point[] { new Point(5, 1), new Point(2, 1), new Point(4, 1), new Point(4, 1), new Point(2, 1), new Point(9, 1), new Point(2, 1), new Point(3, 2) };
    cacheHelper.add(0, items);
    assertThat("1st item do not have previous line cached", cacheHelper.hasPreviousLineCached(0), is(false));
    assertThat("3rd item have previous line cached", cacheHelper.hasPreviousLineCached(2), is(true));
    assertThat("8th item have previous line cached", cacheHelper.hasPreviousLineCached(7), is(true));
    assertThat("9th item do not have previous line cached", cacheHelper.hasPreviousLineCached(9), is(false));
}

[Buggy Hunk]
CacheHelper cacheHelper = new CacheHelper(layoutOptions, contentAreaWidth);

[Patch]
CacheHelper cacheHelper = new CacheHelper(layoutOptions.itemsPerLine, contentAreaWidth);