ListBarWidgetImpl extends ResizeComposite implements ListBarWidget { @Override public void changeTitle(final PartDefinition part, final String title, final IsWidget titleDecoration) { if (part.isSelectable()) { titleDropDown.changeTitle(part, title, titleDecoration); } }  @Override void enableDnd(); @Override void disableDnd(); @Override void setPresenter(final WorkbenchPanelPresenter presenter); @Override void setDndManager(final 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(final boolean hasFocus); @Override void addOnFocusHandler(final Command command); @Override int getPartsSize(); @Override Collection<PartDefinition> getParts(); @Override HandlerRegistration addBeforeSelectionHandler(final BeforeSelectionHandler<PartDefinition> handler); @Override HandlerRegistration addSelectionHandler(final SelectionHandler<PartDefinition> handler); @Override void onResize(); @Override MaximizeToggleButtonPresenter getMaximizeButton(); @Override boolean isDndEnabled(); @Override void enableClosePart(); @Override void disableClosePart(); @Override void disableExpandPart();  }
@Test public void changeTitleForSelectablePart() { final PartDefinition part = getPartDefinition(true, false); final IsWidget widget = mock(IsWidget.class); listBar.changeTitle(part, "title", widget); verify(listBar.titleDropDown).changeTitle(part, "title", widget); }
@Test public void changeTitleForUnselectablePart() { final PartDefinition part = getPartDefinition(false, false); final IsWidget widget = mock(IsWidget.class); listBar.changeTitle(part, "title", widget); verify(listBar.titleDropDown, never()).changeTitle(part, "title", widget); }