AsyncListDifferDelegationAdapter extends RecyclerView.Adapter { @Override public int getItemCount() { return differ.getCurrentList().size(); } AsyncListDifferDelegationAdapter(@NonNull DiffUtil.ItemCallback<T> diffCallback);  AsyncListDifferDelegationAdapter(@NonNull DiffUtil.ItemCallback<T> diffCallback,
                                            @NonNull AdapterDelegatesManager<List<T>> delegatesManager);  AsyncListDifferDelegationAdapter(@NonNull AsyncDifferConfig differConfig,
                                            @NonNull AdapterDelegatesManager<List<T>> delegatesManager);  AsyncListDifferDelegationAdapter(@NonNull DiffUtil.ItemCallback<T> diffCallback,
                                            @NonNull AdapterDelegate<List<T>>... delegates);  AsyncListDifferDelegationAdapter(@NonNull AsyncDifferConfig differConfig,
                                            @NonNull AdapterDelegate<List<T>>... delegates); @NonNull @Override RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType); @Override void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position); @Override void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position, @NonNull List payloads); @Override int getItemViewType(int position); @Override void onViewRecycled(@NonNull RecyclerView.ViewHolder holder); @Override boolean onFailedToRecycleView(@NonNull RecyclerView.ViewHolder holder); @Override void onViewAttachedToWindow(@NonNull RecyclerView.ViewHolder holder); @Override void onViewDetachedFromWindow(@NonNull RecyclerView.ViewHolder holder); List<T> getItems(); void setItems(List<T> items); @Override int getItemCount();  }
@Test @Ignore("Why does Mockito can't mock the final class anymore?") public void checkDelegatesManagerInstance() { final AdapterDelegatesManager<List<Object>> manager = new AdapterDelegatesManager<>(); AsyncDifferConfig<Object> config = Mockito.mock(AsyncDifferConfig.class); AsyncListDifferDelegationAdapter<Object> adapter = new AsyncListDifferDelegationAdapter<Object>(config, manager) { @Override public int getItemCount() { Assert.assertTrue(manager == this.delegatesManager); return 0; } }; adapter.getItemCount(); }