SinglePartPanelHelper { public void closeFirstPartAndAddNewOne(Command command) { placeManager.tryClosePlace(getPlaceFromFirstPart(), command); } SinglePartPanelHelper(Collection<PartDefinition> parts,
                                 PlaceManager placeManager); boolean hasNoParts(); void closeFirstPartAndAddNewOne(Command command);  }
@Test public void closeFirstPartAndAddNewOneTest() { PlaceRequest place = mock(PlaceRequest.class); PartDefinition part = mock(PartDefinition.class); Command cmd = mock(Command.class); when(part.getPlace()).thenReturn(place); Collection<PartDefinition> parts = Arrays.asList(part); singlePartHelper = new SinglePartPanelHelper(parts, placeManager); singlePartHelper.closeFirstPartAndAddNewOne(cmd); verify(placeManager).tryClosePlace(place, cmd); }