Source:
<code>public void testLocallyRecursiveImport() { String type = "workflow"; File recursiveWDL = new File(ResourceHelpers.resourceFilePath("local-recursive-import/localrecursive.wdl")); String primaryDescriptorFilePath = "localrecursive.wdl"; SourceFile sourceFile = new SourceFile(); File recursiveimportWDL = new File(ResourceHelpers.resourceFilePath("local-recursive-import/first-import.wdl")); SourceFile importsourceFile = new SourceFile(); try { sourceFile.setContent(FileUtils.readFileToString(recursiveWDL, StandardCharsets.UTF_8)); sourceFile.setAbsolutePath("/localrecursive.wdl"); sourceFile.setPath("localrecursive.wdl"); sourceFile.setType(DescriptorLanguage.FileType.DOCKSTORE_WDL); importsourceFile.setContent(FileUtils.readFileToString(recursiveimportWDL, StandardCharsets.UTF_8)); importsourceFile.setAbsolutePath("/first-import.wdl"); importsourceFile.setPath("first-import.wdl"); importsourceFile.setType(DescriptorLanguage.FileType.DOCKSTORE_WDL); Set<SourceFile> sourceFileSet = new HashSet<>(); sourceFileSet.add(sourceFile); sourceFileSet.add(importsourceFile); WDLHandler wdlHandler = new WDLHandler(); VersionTypeValidation validation = wdlHandler.validateEntrySet(sourceFileSet, primaryDescriptorFilePath, type); Assert.assertFalse(validation.isValid()); <START> Optional<Map.Entry<String, String>> validationEntryMap = validation.getMessage().entrySet().stream() <END> .filter(msg -> StringUtils.contains(msg.getValue(), "Recursive local import detected")).findAny(); Assert.assertTrue(validationEntryMap.isPresent()); } catch (IOException e) { Assert.fail(); } }</code><technical_language>If instead of validation.getMessage().entrySet... validation.getMessage.values()... code a complicated</technical_language>

Target:
public void testLocallyRecursiveImport() { String type = "workflow"; File recursiveWDL = new File(ResourceHelpers.resourceFilePath("local-recursive-import/localrecursive.wdl")); String primaryDescriptorFilePath = "localrecursive.wdl"; SourceFile sourceFile = new SourceFile(); File recursiveimportWDL = new File(ResourceHelpers.resourceFilePath("local-recursive-import/first-import.wdl")); SourceFile importsourceFile = new SourceFile(); try { sourceFile.setContent(FileUtils.readFileToString(recursiveWDL, StandardCharsets.UTF_8)); sourceFile.setAbsolutePath("/localrecursive.wdl"); sourceFile.setPath("localrecursive.wdl"); sourceFile.setType(DescriptorLanguage.FileType.DOCKSTORE_WDL); importsourceFile.setContent(FileUtils.readFileToString(recursiveimportWDL, StandardCharsets.UTF_8)); importsourceFile.setAbsolutePath("/first-import.wdl"); importsourceFile.setPath("first-import.wdl"); importsourceFile.setType(DescriptorLanguage.FileType.DOCKSTORE_WDL); Set<SourceFile> sourceFileSet = new HashSet<>(); sourceFileSet.add(sourceFile); sourceFileSet.add(importsourceFile); WDLHandler wdlHandler = new WDLHandler(); VersionTypeValidation validation = wdlHandler.validateEntrySet(sourceFileSet, primaryDescriptorFilePath, type); assertFalse(validation.isValid()); assertTrue(validation.getMessage().values().stream() .anyMatch(msg -> StringUtils.contains(msg, ERROR_PARSING_WORKFLOW_RECURSIVE_LOCAL_IMPORT))); } catch (IOException e) { Assert.fail(); } }