@Test public void testFromAlphabeticCollectionWithoutData() { final AlphabeticHeaders.ModuleAdapter mockAdapter = mock(AlphabeticHeaders.ModuleAdapter.class); final Module module = new Module(); module.attachToAdapter(mockAdapter); final Collection<AlphabeticHeaders.AlphabeticItem> items = new ArrayList<>(0); module.fromAlphabeticCollection(items); assertThat(module.size(), is(0)); verify(mockAdapter).notifyDataSetChanged(); verifyNoMoreInteractions(mockAdapter); }
public <Item extends AlphabeticItem> void fromAlphabeticCollection(@NonNull final Collection<Item> collection) { clearHeaders(); if (!collection.isEmpty()) { int position = 0; for (final Item item : collection) { onProcessItem(position++, item); } } notifyAdapter(); }
AlphabeticHeaders extends HeadersModule<VH, HeadersModule.SimpleHeader> { public <Item extends AlphabeticItem> void fromAlphabeticCollection(@NonNull final Collection<Item> collection) { clearHeaders(); if (!collection.isEmpty()) { int position = 0; for (final Item item : collection) { onProcessItem(position++, item); } } notifyAdapter(); } }
AlphabeticHeaders extends HeadersModule<VH, HeadersModule.SimpleHeader> { public <Item extends AlphabeticItem> void fromAlphabeticCollection(@NonNull final Collection<Item> collection) { clearHeaders(); if (!collection.isEmpty()) { int position = 0; for (final Item item : collection) { onProcessItem(position++, item); } } notifyAdapter(); }  }
AlphabeticHeaders extends HeadersModule<VH, HeadersModule.SimpleHeader> { public <Item extends AlphabeticItem> void fromAlphabeticCollection(@NonNull final Collection<Item> collection) { clearHeaders(); if (!collection.isEmpty()) { int position = 0; for (final Item item : collection) { onProcessItem(position++, item); } } notifyAdapter(); }  void fromAlphabeticCursor(@NonNull final C cursor); void fromAlphabeticCollection(@NonNull final Collection<Item> collection); @Override @CallSuper void clearHeaders(); }
AlphabeticHeaders extends HeadersModule<VH, HeadersModule.SimpleHeader> { public <Item extends AlphabeticItem> void fromAlphabeticCollection(@NonNull final Collection<Item> collection) { clearHeaders(); if (!collection.isEmpty()) { int position = 0; for (final Item item : collection) { onProcessItem(position++, item); } } notifyAdapter(); }  void fromAlphabeticCursor(@NonNull final C cursor); void fromAlphabeticCollection(@NonNull final Collection<Item> collection); @Override @CallSuper void clearHeaders();  }