DiffUtilCallback extends DiffUtil.Callback { @Override public int getOldListSize() { return oldItems == null ? 0 : oldItems.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 shouldReturnOldSize() throws Exception { assertEquals(3, diffUtilCallback.getOldListSize()); }