DataSetExplorer implements IsWidget { public void show() { clear(); clientServices.getPublicDataSetDefs(dataSetDefs -> { if (dataSetDefs != null && !dataSetDefs.isEmpty()) { dataSetDefs.stream() .filter(DataSetExplorer.this::isSupported) .sorted((o1, o2) -> o1.getName().compareTo(o2.getName())) .forEach(DataSetExplorer.this::addDataSetDef); } }); } @Inject  DataSetExplorer(final Instance<DataSetPanel> panelInstances,
                           final DataSetClientServices clientServices,
                           final View view); @PostConstruct void init(); @Override Widget asWidget(); void show();  }
@Test public void testShow() throws Exception { presenter.show(); assertEquals(1, presenter.panels.size()); assertEquals(dataSetPanel, presenter.panels.get(0)); verify(view, times(1)).clear(); verify(view, times(1)).addPanel(any(DataSetPanel.View.class)); verify(dataSetPanel, times(1)).show(dataSetDef, "dataSetsExplorerPanelGroup"); }