### Question:
DMNDiagramHelper { public List<ItemDefinition> getItemDefinitions(final Diagram diagram) { return dmnDiagramUtils.getDefinitions(diagram).getItemDefinition(); } @Inject  DMNDiagramHelper(final DiagramService diagramService,
                            final DMNDiagramUtils dmnDiagramUtils); List<DRGElement> getNodes(final Diagram diagram); List<ItemDefinition> getItemDefinitions(final Diagram diagram); String getNamespace(final Path path); String getNamespace(final Diagram diagram); Diagram<Graph, Metadata> getDiagramByPath(final Path path);  }### Answer:
@Test public void testGetItemDefinitionsByDiagram() { final Definitions definitions = mock(Definitions.class); final List<ItemDefinition> expectedItemDefinitions = asList(mock(ItemDefinition.class), mock(ItemDefinition.class)); when(definitions.getItemDefinition()).thenReturn(expectedItemDefinitions); when(dmnDiagramUtils.getDefinitions(diagram)).thenReturn(definitions); final List<ItemDefinition> actualItemDefinitions = helper.getItemDefinitions(diagram); assertEquals(expectedItemDefinitions, actualItemDefinitions); }