DiffUtilCallback extends DiffUtil.Callback { @Override public int getNewListSize() { return newItems == null ? 0 : newItems.size(); } DiffUtilCallback(List<?> oldItems, List<?> newItems, @NonNull DiffCallback diffCallback); @Override int getOldListSize(); @Override int getNewListSize(); @Override boolean areItemsTheSame(int oldItemPosition, int newItemPosition); @Override boolean areContentsTheSame(int oldItemPosition, int newItemPosition); @Override int hashCode(); @Override boolean equals(Object o);  }
@Test public void shouldReturnNewSize() throws Exception { assertEquals(4, diffUtilCallback.getNewListSize()); }