MultiScreenPartWidget extends Composite implements MultiPartWidget { @Override public boolean selectPart(final PartDefinition part) { if (parts.containsKey(part) == false) { return false; } parts.entrySet().forEach(e -> { if (e.getKey().equals(part)) { e.getValue().show(); } else { e.getValue().hide(); } }); return true; }  @Override void setPresenter(final WorkbenchPanelPresenter presenter); @Override void setDndManager(WorkbenchDragAndDropManager dndManager); @Override void clear(); @Override void addPart(final WorkbenchPartPresenter.View view); @Override void changeTitle(final PartDefinition part,
                            final String title,
                            final IsWidget titleDecoration); @Override boolean selectPart(final PartDefinition part); @Override boolean remove(final PartDefinition part); @Override void setFocus(boolean hasFocus); @Override void addOnFocusHandler(final Command doWhenFocused); @Override int getPartsSize(); @Override Collection<PartDefinition> getParts(); @Override HandlerRegistration addBeforeSelectionHandler(final BeforeSelectionHandler<PartDefinition> handler); @Override HandlerRegistration addSelectionHandler(final SelectionHandler<PartDefinition> handler); @Override Widget asWidget(); @Override void onResize();  }
@Test public void testInvalidSelectPart() { boolean selected = widget.selectPart(partDefinition); assertFalse(selected); }
@Test public void testSelectPart() { widget.addPart(view); boolean selected = widget.selectPart(partDefinition); verify(multiScreenView, times(2)).show(); assertTrue(selected); }