### Question:
DMNProjectToolbarStateHandler implements ToolbarStateHandler { @Override public void enterGridView() { commandStates.entrySet().forEach(entry -> { final Class<? extends ClientSessionCommand> command = entry.getKey(); entry.setValue(projectEditorMenuSessionItems.isItemEnabled(command)); projectEditorMenuSessionItems.setItemEnabled(command, false); }); } @SuppressWarnings("unchecked")  DMNProjectToolbarStateHandler(final AbstractDiagramEditorMenuSessionItems projectEditorMenuSessionItems); @Override void enterGridView(); @Override void enterGraphView();  }### Answer:
@Test public void testEnterGridView() { toolbarStateHandler.enterGridView(); verify(editorMenuSessionItems).setItemEnabled(ClearSessionCommand.class, false); verify(editorMenuSessionItems).setItemEnabled(SwitchGridSessionCommand.class, false); verify(editorMenuSessionItems).setItemEnabled(VisitGraphSessionCommand.class, false); verify(editorMenuSessionItems).setItemEnabled(DeleteSelectionSessionCommand.class, false); verify(editorMenuSessionItems).setItemEnabled(CutSelectionSessionCommand.class, false); verify(editorMenuSessionItems).setItemEnabled(CopySelectionSessionCommand.class, false); verify(editorMenuSessionItems).setItemEnabled(PasteSelectionSessionCommand.class, false); verify(editorMenuSessionItems).setItemEnabled(PerformAutomaticLayoutCommand.class, false); }
@Test public void testEnterGridView() { toolbarStateHandler.enterGridView(); verify(editorMenuSessionItems).setItemEnabled(ClearSessionCommand.class, false); verify(editorMenuSessionItems).setItemEnabled(SwitchGridSessionCommand.class, false); verify(editorMenuSessionItems).setItemEnabled(VisitGraphSessionCommand.class, false); verify(editorMenuSessionItems).setItemEnabled(DeleteSelectionSessionCommand.class, false); verify(editorMenuSessionItems).setItemEnabled(CutSelectionSessionCommand.class, false); verify(editorMenuSessionItems).setItemEnabled(CopySelectionSessionCommand.class, false); verify(editorMenuSessionItems).setItemEnabled(PasteSelectionSessionCommand.class, false); }