### Question:
Differ { public static <T> DiffResult<T> diff(Collection<T> a, Collection<T> b) { return new Differ<>(a, b).diff(); }  static DiffResult<T> diff(Collection<T> a, Collection<T> b);  }### Answer:
@Test public void test() { DiffResult<Integer> result = Differ.diff(Arrays.asList(1, 2, 3, 3), Arrays.asList(1, 3, 4)); assertThat(result.getCommon()).hasSize(2); assertThat(result.getCommon()).contains(1, 3); assertThat(result.getOnlyA()).hasSize(1); assertThat(result.getOnlyA()).contains(2); assertThat(result.getOnlyB()).hasSize(1); assertThat(result.getOnlyB()).contains(4); }
@Test public void testIsSame() { assertThat(Differ.diff(Arrays.asList(1, 2, 3), Arrays.asList(1, 2, 3)).isSame()).isTrue(); assertThat(Differ.diff(Arrays.asList(1, 2, 3), Arrays.asList(1, 3)).isSame()).isFalse(); }