StaticWorkbenchPanelView extends AbstractWorkbenchPanelView<StaticWorkbenchPanelPresenter> { SelectionHandler<PartDefinition> getPanelSelectionHandler() { return event -> { final PartDefinition selectedItem = event.getSelectedItem(); if (!Objects.equals(selectedItem, panelManager.getFocusedPart())) { panelManager.onPartLostFocus(); panelManager.onPartFocus(selectedItem); } }; }  @Override Widget getWidget(); StaticFocusedResizePanel getPanel(); @Override void init(final StaticWorkbenchPanelPresenter presenter); @Override StaticWorkbenchPanelPresenter getPresenter(); @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 removePart(final PartDefinition part); @Override void setFocus(boolean hasFocus); @Override void onResize(); @Override Collection<PartDefinition> getParts();  }
@Test public void testOnPartFocus() { final PartDefinition selectedItem = mock(PartDefinition.class); final SelectionHandler<PartDefinition> handler = view.getPanelSelectionHandler(); when(selectionEvent.getSelectedItem()).thenReturn(selectedItem); when(panelManager.getFocusedPart()).thenReturn(null, selectedItem); handler.onSelection(selectionEvent); handler.onSelection(selectionEvent); verify(panelManager).onPartLostFocus(); verify(panelManager).onPartFocus(selectedItem); }