### Question:
PMMLIncludedDocumentsFilter { public PMMLDocumentMetadata getDocumentFromImports(final Path dmnModelPath, final Path includedModelPath, final List<PMMLIncludedModel> includedModels) { final Optional<PMMLIncludedModel> documentImport = getDocumentImport(dmnModelPath, includedModelPath, includedModels); return documentImport .map(pmml -> pmmlDocumentFactory.getDocumentByPath(includedModelPath, pmml)) .orElse(null); } @Inject  PMMLIncludedDocumentsFilter(final DMNPathsHelper pathsHelper,
                                       final PMMLIncludedDocumentFactory pmmlDocumentFactory); PMMLDocumentMetadata getDocumentFromImports(final Path dmnModelPath,
                                                       final Path includedModelPath,
                                                       final List<PMMLIncludedModel> includedModels);  }### Answer:
@Test public void testGetDocumentFromImportsWithNoImports() { assertThat(filter.getDocumentFromImports(dmnModelPath, includedModelPath, includedModels)).isNull(); }
@Test public void testGetDocumentFromImportsWithImportsFileIsNotImported() { includedModels.add(new PMMLIncludedModel(NAME, PACKAGE, IMPORT_PATH, DMNImportTypes.DMN.getDefaultNamespace(), MODEL_COUNT)); when(pathsHelper.getRelativeURI(dmnModelPath, includedModelPath)).thenReturn("includedModelPath"); assertThat(filter.getDocumentFromImports(dmnModelPath, includedModelPath, includedModels)).isNull(); }
@Test public void testGetDocumentFromImportsWithImportsFileIsImported() { includedModels.add(new PMMLIncludedModel(NAME, PACKAGE, IMPORT_PATH, DMNImportTypes.DMN.getDefaultNamespace(), MODEL_COUNT)); when(pathsHelper.getRelativeURI(dmnModelPath, includedModelPath)).thenReturn(IMPORT_PATH); assertThat(filter.getDocumentFromImports(dmnModelPath, includedModelPath, includedModels)).isEqualTo(pmmlDocumentMetadata); }