void (String in, String pattern, LanguageFileType fileType, String... expectedResults) { final List<MatchResult> matches = findMatches(in, pattern, fileType); final List<String> actualResults = ContainerUtil.map(matches, r -> StructuralSearchUtil.getPresentableElement(r.getMatch()).getText()); assertEquals(String.join("\n", actualResults), expectedResults.length, actualResults.size()); for (int i = 0, length = expectedResults.length; i < length; i++) { assertEquals(expectedResults[i], actualResults.get(i)); } }