### Question:
PersistencePresenter extends Section<ProjectScreenModel> { @Override public Promise<Void> save(final String comment, final Supplier<Promise<Void>> chain) { if (concurrentPersistenceXmlUpdateInfo == null) { return save(comment); } else { notificationEvent.fire(new NotificationEvent(view.getConcurrentUpdateMessage(), WARNING)); return setup(); } } @Inject  PersistencePresenter(final View view,
                                final WorkspaceProjectContext projectContext,
                                final Promises promises,
                                final MenuItem<ProjectScreenModel> menuItem,
                                final Event<NotificationEvent> notificationEvent,
                                final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                final ManagedInstance<ObservablePath> observablePaths,
                                final Caller<PersistenceDescriptorEditorService> editorService,
                                final Caller<DataModelerService> dataModelerService,
                                final PropertiesListPresenter propertiesListPresenter,
                                final PersistableDataObjectsListPresenter persistableDataObjectsListPresenter); @Override Promise<Void> setup(final ProjectScreenModel model); @Override Promise<Object> validate(); @Override Promise<Void> save(final String comment,
                              final Supplier<Promise<Void>> chain); void add(final String className); void add(final Property property); void addAllProjectsPersistableDataObjects(); void setDataSource(final String dataSource); void setPersistenceUnit(final String persistenceUnit); void setPersistenceProvider(final String persistenceProvider); void addNewProperty(); void addNewPersistableDataObject(); @Override int currentHashCode(); @Override SectionView<?> getView();  }### Answer:
@Test public void testSave() { doReturn(promises.resolve()).when(persistencePresenter).save(eq("Test comment")); persistencePresenter.save("Test comment", null).catch_(i -> { Assert.fail("Promise should've been resolved!"); return promises.resolve(); }); verify(persistencePresenter).save(eq("Test comment")); verify(persistencePresenter, never()).setup(); verify(notificationEvent, never()).fire(any()); }
@Test public void testSaveModel() { persistencePresenter.persistenceDescriptorEditorContent = newPersistenceDescriptorEditorContent(); doReturn(mock(Path.class)).when(editorService).save(any(), any(), any(), eq("Test comment")); persistencePresenter.save("Test comment").catch_(i -> { Assert.fail("Promise should've been resolved!"); return promises.resolve(); }); verify(editorService).save(any(), any(), any(), eq("Test comment")); }