### Question:
DMNDiagramUtils { public List<DRGElement> getDRGElements(final Diagram diagram) { return getDefinitionStream(diagram) .filter(d -> d instanceof DRGElement) .map(d -> (DRGElement) d) .collect(Collectors.toList()); } DMNDiagramUtils(); List<DRGElement> getDRGElements(final Diagram diagram); String getNamespace(final Diagram diagram); Definitions getDefinitions(final Diagram diagram); Stream<Object> getDefinitionStream(final Diagram diagram); @SuppressWarnings("unchecked") Stream<Node> getNodeStream(final Diagram diagram);  }### Answer:
@Test public void testGetNodes() { final DRGElement drgElement = mock(DRGElement.class); when(definition.getDefinition()).thenReturn(drgElement); final List<DRGElement> actualNodes = utils.getDRGElements(diagram); final List<DRGElement> expectedNodes = singletonList(drgElement); assertEquals(expectedNodes, actualNodes); }