### Question:
ProjectMenu { public List<MenuItem> getMenuItems() { enableToolsMenuItems((KieModule) context.getActiveModule().orElse(null)); ArrayList<MenuItem> menuItems = new ArrayList<>(); menuItems.add(projectScreen); menuItems.add(projectStructureScreen); return menuItems; } ProjectMenu(); @Inject  ProjectMenu(final PlaceManager placeManager,
                       final WorkspaceProjectContext context); List<MenuItem> getMenuItems(); void onWorkspaceProjectContextChanged(@Observes final WorkspaceProjectContextChangeEvent event);  }### Answer:
@Test public void getMenuItemsSynchronizesDisabledState() { final List<MenuItem> menus = menu.getMenuItems(); assertFalse(menus.get(0).isEnabled()); assertTrue(menus.get(1).isEnabled()); }
@Test public void getMenuItemsSynchronizesEnabledState() { when(projectContext.getActiveModule()).thenReturn(Optional.of(mock(KieModule.class))); final List<MenuItem> menus = menu.getMenuItems(); assertTrue(menus.get(0).isEnabled()); assertTrue(menus.get(1).isEnabled()); }