### Question:
KieMultipleDocumentEditor implements KieMultipleDocumentEditorPresenter<D> { @PostConstruct protected void setupMenuBar() { makeMenuBar(); kieEditorWrapperView.init(this); } KieMultipleDocumentEditor();  KieMultipleDocumentEditor(final KieEditorView editorView); @Override void registerDocument(final D document); @Override void deregisterDocument(final D document); @Override void activateDocument(final D document,
                                 final Overview overview,
                                 final AsyncPackageDataModelOracle dmo,
                                 final Imports imports,
                                 final boolean isReadOnly); @Override D getActiveDocument(); @Override IsWidget getWidget(); @Override IsWidget getTitleWidget(final D document); @Override void getMenus(final Consumer<Menus> menusConsumer); @Override void onClose(); @Override void onSourceTabSelected(); @Override void updateSource(final String source); @Override void onEditTabSelected(); @Override void onEditTabUnselected(); @Override void onOverviewSelected(); @Override boolean mayClose(final Integer originalHashCode,
                            final Integer currentHashCode); @Override Promise<Void> makeMenuBar();  }### Answer:
@Test public void testSetupMenuBar() { doReturn(Optional.of(mock(WorkspaceProject.class))).when(workbenchContext).getActiveWorkspaceProject(); doReturn(promises.resolve(true)).when(projectController).canUpdateProject(any()); editor.setupMenuBar(); verify(fileMenuBuilder).addSave(any(MenuItem.class)); verify(fileMenuBuilder).addCopy(any(BasicFileMenuBuilder.PathProvider.class), eq(assetUpdateValidator)); verify(fileMenuBuilder).addRename(any(BasicFileMenuBuilder.PathProvider.class), eq(assetUpdateValidator)); verify(fileMenuBuilder).addDelete(any(BasicFileMenuBuilder.PathProvider.class), eq(assetUpdateValidator)); verify(fileMenuBuilder).addValidate(any(Command.class)); verify(fileMenuBuilder).addNewTopLevelMenu(downloadMenuItemButton); verify(fileMenuBuilder, times(3)).addNewTopLevelMenu(any(MenuItem.class)); }
@Test public void testSetupMenuBarWithoutUpdateProjectPermission() { doReturn(Optional.of(mock(WorkspaceProject.class))).when(workbenchContext).getActiveWorkspaceProject(); doReturn(promises.resolve(false)).when(projectController).canUpdateProject(any()); editor.setupMenuBar(); verify(fileMenuBuilder, never()).addSave(any(MenuItem.class)); verify(fileMenuBuilder, never()).addCopy(any(BasicFileMenuBuilder.PathProvider.class), eq(assetUpdateValidator)); verify(fileMenuBuilder, never()).addRename(any(BasicFileMenuBuilder.PathProvider.class), eq(assetUpdateValidator)); verify(fileMenuBuilder, never()).addDelete(any(BasicFileMenuBuilder.PathProvider.class), eq(assetUpdateValidator)); verify(fileMenuBuilder).addValidate(any(Command.class)); verify(fileMenuBuilder).addNewTopLevelMenu(downloadMenuItemButton); verify(fileMenuBuilder, times(3)).addNewTopLevelMenu(any(MenuItem.class)); }