void (Editor editor, GotoTargetHandler.GotoData gotoData, boolean renderModule) { String documentText = editor.getDocument().getText(); // Get expected references from the tested document List<String> expectedReferences = InTextDirectivesUtils.findListWithPrefixes(documentText, "// REF:"); for (int i = 0; i < expectedReferences.size(); i++) { String expectedText = expectedReferences.get(i); expectedText = expectedText.replace("\\n", "\n"); if (!expectedText.startsWith("<")) { expectedText = PathUtil.toSystemDependentName(expectedText).replace("//", "/"); } expectedReferences.set(i, expectedText); } Collections.sort(expectedReferences); if (gotoData != null) { List<PsiElement> targets; if (InTextDirectivesUtils.isDirectiveDefined(documentText, "// DISTINCT_REF")) { targets = ArraysKt.distinctBy(gotoData.targets, LightClassUtilsKt::getUnwrapped); } else { targets = Arrays.asList(gotoData.targets); } // Transform given reference result to strings List<String> psiElements = targets.stream().map(element -> { Assert.assertNotNull(element); return ReferenceUtils.renderAsGotoImplementation(element, renderModule); }).collect(Collectors.toList()); // Compare UsefulTestCase.assertOrderedEquals(Ordering.natural().sortedCopy(psiElements), expectedReferences); } else { UsefulTestCase.assertOrderedEquals(Collections.emptyList(), expectedReferences); } }