BeforeAndAfter { public Set<T> getIntersectedItems() { final HashSet<T> intersection = new HashSet<>(before); intersection.retainAll(after); return intersection; }  Set<T> getAddedItems(); Set<T> getRemovedItems(); Set<T> getIntersectedItems(); Set<T> getUnionedItems();  }
@Test public void testGetIntersectedItems() { assertEquals(new HashSet<>(asList(item2, item3)), beforeAndAfter.getIntersectedItems()); }