@Test public void testRegisterDataSetObserver() { final ListAdapter mockAdapter = mock(ListAdapter.class); final AdapterWrapper wrapper = new AdapterWrapper(mockAdapter); final DataSetObserver dataSetObserver = new DataSetObserver() {}; wrapper.registerDataSetObserver(dataSetObserver); verify(mockAdapter).registerDataSetObserver(dataSetObserver); verifyNoMoreInteractions(mockAdapter); }
@Override public void registerDataSetObserver(@NonNull final DataSetObserver observer) { if (adapter != null) adapter.registerDataSetObserver(observer); }
AdapterWrapper implements WrapperListAdapter { @Override public void registerDataSetObserver(@NonNull final DataSetObserver observer) { if (adapter != null) adapter.registerDataSetObserver(observer); } }
AdapterWrapper implements WrapperListAdapter { @Override public void registerDataSetObserver(@NonNull final DataSetObserver observer) { if (adapter != null) adapter.registerDataSetObserver(observer); } AdapterWrapper(@Nullable final ListAdapter adapter); }
AdapterWrapper implements WrapperListAdapter { @Override public void registerDataSetObserver(@NonNull final DataSetObserver observer) { if (adapter != null) adapter.registerDataSetObserver(observer); } AdapterWrapper(@Nullable final ListAdapter adapter); @Override @Nullable ListAdapter getWrappedAdapter(); @Override void registerDataSetObserver(@NonNull final DataSetObserver observer); @Override void unregisterDataSetObserver(@NonNull final DataSetObserver observer); @Override boolean isEmpty(); @Override int getCount(); @Override @Nullable Object getItem(final int position); @Override boolean hasStableIds(); @Override long getItemId(final int position); @Override int getViewTypeCount(); @Override int getItemViewType(final int position); @Override View getView(final int position, @Nullable final View convertView, @NonNull final ViewGroup parent); @Override boolean areAllItemsEnabled(); @Override boolean isEnabled(final int position); }
AdapterWrapper implements WrapperListAdapter { @Override public void registerDataSetObserver(@NonNull final DataSetObserver observer) { if (adapter != null) adapter.registerDataSetObserver(observer); } AdapterWrapper(@Nullable final ListAdapter adapter); @Override @Nullable ListAdapter getWrappedAdapter(); @Override void registerDataSetObserver(@NonNull final DataSetObserver observer); @Override void unregisterDataSetObserver(@NonNull final DataSetObserver observer); @Override boolean isEmpty(); @Override int getCount(); @Override @Nullable Object getItem(final int position); @Override boolean hasStableIds(); @Override long getItemId(final int position); @Override int getViewTypeCount(); @Override int getItemViewType(final int position); @Override View getView(final int position, @Nullable final View convertView, @NonNull final ViewGroup parent); @Override boolean areAllItemsEnabled(); @Override boolean isEnabled(final int position);  }