PartStackPresenter implements Presenter, PartStackView.ActionDelegate, PartStack { @Override public void hidePart(PartPresenter part) { if (activePart == part) { if (workBenchPartController != null) { double size = workBenchPartController.getSize(); partSizes.put(activePart, Double.valueOf(size)); workBenchPartController.setHidden(true); } activePart = null; view.setActiveTab(-1); } } @Inject  PartStackPresenter(EventBus eventBus,
                              PartStackEventHandler partStackEventHandler,
                              @Assisted final PartStackView view,
                              @Assisted WorkBenchPartController workBenchPartController); @Override void go(AcceptsOneWidget container); @Override void addPart(PartPresenter part); @Override void addPart(PartPresenter part, Constraints constraint); @Override boolean containsPart(PartPresenter part); @Override int getNumberOfParts(); @Override PartPresenter getActivePart(); @Override void setActivePart(PartPresenter part); List<PartPresenter> getPartPresenters(); @Override void hidePart(PartPresenter part); @Override void removePart(PartPresenter part); @Override void onRequestFocus(); @Override void setFocus(boolean focused);  }
@Test public void testHidePart() { reset(view); presenter.activePart = part; presenter.hidePart(part); verify(view).setActiveTab(eq(-1)); Assert.assertNull(presenter.activePart); }