EditScreen extends BaseModal { boolean shouldICleanupPlaceRequest() { return oldPlaceName() != null && oldPlaceName() != currentPlaceName(); } EditScreen(ModalConfigurationContext configContext,
                      List<String> availableWorkbenchScreensIds,
                      Command cleanupPlaceRequest); void show(); @Override void hide(); static String PROPERTY_EDITOR_KEY; }
@Test public void shouldICleanupPlaceRequestTest() { EditScreen edit = spy(new EditScreen(mock(ModalConfigurationContext.class), new ArrayList<>(), () -> { })); assertFalse(edit.shouldICleanupPlaceRequest()); when(edit.oldPlaceName()).thenReturn("some"); when(edit.currentPlaceName()).thenReturn("some"); assertFalse(edit.shouldICleanupPlaceRequest()); when(edit.oldPlaceName()).thenReturn("some"); when(edit.currentPlaceName()).thenReturn("another"); assertTrue(edit.shouldICleanupPlaceRequest()); }