@Test public void calculate_allRemoved() { DiffHelper.Result result = DiffHelper.calculate(Arrays.asList(A, B), Collections.emptyList()); assertContentsEqual(Collections.emptyList(), result.getInserted()); assertContentsEqual(Arrays.asList(A, B), result.getRemoved()); }
public static <E> Result<E> calculate(@NonNull Collection<E> oldList, @NonNull Collection<E> newList) { Set<E> inserted = SetUtil.difference(newList, oldList); Set<E> removed = SetUtil.difference(oldList, newList); return new Result<>(inserted, removed); }
DiffHelper { public static <E> Result<E> calculate(@NonNull Collection<E> oldList, @NonNull Collection<E> newList) { Set<E> inserted = SetUtil.difference(newList, oldList); Set<E> removed = SetUtil.difference(oldList, newList); return new Result<>(inserted, removed); } }
DiffHelper { public static <E> Result<E> calculate(@NonNull Collection<E> oldList, @NonNull Collection<E> newList) { Set<E> inserted = SetUtil.difference(newList, oldList); Set<E> removed = SetUtil.difference(oldList, newList); return new Result<>(inserted, removed); }  }
DiffHelper { public static <E> Result<E> calculate(@NonNull Collection<E> oldList, @NonNull Collection<E> newList) { Set<E> inserted = SetUtil.difference(newList, oldList); Set<E> removed = SetUtil.difference(oldList, newList); return new Result<>(inserted, removed); }  static Result<E> calculate(@NonNull Collection<E> oldList, @NonNull Collection<E> newList); }
DiffHelper { public static <E> Result<E> calculate(@NonNull Collection<E> oldList, @NonNull Collection<E> newList) { Set<E> inserted = SetUtil.difference(newList, oldList); Set<E> removed = SetUtil.difference(oldList, newList); return new Result<>(inserted, removed); }  static Result<E> calculate(@NonNull Collection<E> oldList, @NonNull Collection<E> newList);  }