### Question:
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public DocumentationOutput generate(final Diagram diagram) { return Optional.ofNullable(diagram) .map(this::processDocumentation) .map(dmnDocumentation -> buildDocumentation(getDocumentationTemplate(), dmnDocumentation)) .orElse(EMPTY); } @Inject  DMNDocumentationServiceImpl(final ClientMustacheTemplateRenderer mustacheTemplateRenderer,
                                       final DMNDocumentationFactory dmnDocumentationFactory); @Override DMNDocumentation processDocumentation(final Diagram diagram); @Override HTMLDocumentationTemplate getDocumentationTemplate(); @Override DocumentationOutput buildDocumentation(final HTMLDocumentationTemplate template,
                                                  final DMNDocumentation diagramDocumentation); @Override DocumentationOutput generate(final Diagram diagram);  }### Answer:
@Test public void testGenerateWhenDiagramIsNotPresent() { final DocumentationOutput expectedOutput = DocumentationOutput.EMPTY; final DocumentationOutput actualOutput = service.generate(null); assertEquals(expectedOutput, actualOutput); }