DataSetDefEditorPresenter extends BaseEditor<DataSetDef, DefaultMetadata> { @OnMayClose public boolean onMayClose() { workflow.flush(); return super.mayClose(getCurrentModelHash()); }  @OnStartup void onStartup(final ObservablePath path,
                          final PlaceRequest place); @WorkbenchPartTitleDecoration IsWidget getTitle(); @WorkbenchPartTitle String getTitleText(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @WorkbenchPartView Widget getWidget(); @OnMayClose boolean onMayClose(); @OnClose void onClose(); DataSetDef getDataSetDef(); int getCurrentModelHash(); void disposeWorkflow(); @Inject
    public DataSetDefScreenView view; }
@Test public void testOnMayClose() { presenter.loadContent(); when(editWorkflow.getDataSetDef()).thenReturn(mock(DataSetDef.class)); presenter.onMayClose(); verify(view).confirmClose(); assertTrue(presenter.isDirty(presenter.getCurrentModelHash())); }