### Question:
ListSelector extends AbstractPopoverImpl<ListSelectorView, HasListSelectorControl> implements ListSelectorView.Presenter { @Override public void bind(final HasListSelectorControl bound, final int uiRowIndex, final int uiColumnIndex) { super.bind(bound, uiRowIndex, uiColumnIndex); binding.ifPresent(b -> { final List<ListSelectorItem> items = b.getItems(uiRowIndex, uiColumnIndex); if (items.isEmpty()) { bind(null, uiRowIndex, uiColumnIndex); } else { view.setItems(b.getItems(uiRowIndex, uiColumnIndex)); } }); } ListSelector(); @Inject  ListSelector(final ListSelectorView view); @Override void onItemSelected(final ListSelectorItem item); @Override void bind(final HasListSelectorControl bound,
                     final int uiRowIndex,
                     final int uiColumnIndex);  }### Answer:
@Test public void testShow() { listSelector.bind(bound, 0, 0); listSelector.show(); verify(view).show(Optional.empty()); }
@Test public void testHide() { listSelector.bind(bound, 0, 0); listSelector.hide(); verify(view).hide(); }
@Test public void testBindWithItems() { listSelector.bind(bound, 0, 0); verify(view).setItems(itemsCaptor.capture()); assertThat(itemsCaptor.getValue()).containsOnly(listSelectorItem1, listSelectorItem2); listSelector.show(); verify(view).show(Optional.empty()); }
@Test @SuppressWarnings("unchecked") public void testBindWithNoItems() { when(bound.getItems(anyInt(), anyInt())).thenReturn(Collections.emptyList()); listSelector.bind(bound, 0, 0); verify(view, never()).setItems(anyList()); listSelector.show(); verify(view, never()).show(Optional.empty()); }