MultiScreenPartWidget extends Composite implements MultiPartWidget { @Override public void changeTitle(final PartDefinition part, final String title, final IsWidget titleDecoration) { final MultiScreenView screen = parts.get(part); if (screen != null) { screen.setTitle(title); if (titleDecoration != null) { screen.setTitleWidget(titleDecoration); } } }  @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 testInvalidChangeTitle() { widget.changeTitle(partDefinition, null, null); }
@Test public void testChangeTitle() { String title = "newTitle"; IsWidget titleWidget = mock(IsWidget.class); widget.addPart(view); widget.changeTitle(partDefinition, title, titleWidget); verify(multiScreenView).setTitle(title); verify(multiScreenView).setTitleWidget(titleWidget); }