SinglePartPanelHelper { PlaceRequest getPlaceFromFirstPart() { if (parts.iterator().hasNext()) { PartDefinition part = this.parts.iterator().next(); if (part != null) { return part.getPlace(); } } return null; } SinglePartPanelHelper(Collection<PartDefinition> parts,
                                 PlaceManager placeManager); boolean hasNoParts(); void closeFirstPartAndAddNewOne(Command command);  }
@Test public void getPlaceFromFirstPartTest() { PlaceRequest place = mock(PlaceRequest.class); PartDefinition part = mock(PartDefinition.class); when(part.getPlace()).thenReturn(place); Collection<PartDefinition> parts = Arrays.asList(part); singlePartHelper = new SinglePartPanelHelper(parts, placeManager); assertTrue(!singlePartHelper.hasNoParts()); assertEquals(place, singlePartHelper.getPlaceFromFirstPart()); }