void (@NotNull String text, @NotNull Function<JavaCodeInsightTestFixture, IndentGuidesProvider> guidesProviderFactory) { IndentGuideTestData testData = parse(text, myFixture.getProject()); myFixture.configureByText(getTestName(false) + ".java", testData.myText); CodeInsightTestFixtureImpl.instantiateAndRun(myFixture.getFile(), myFixture.getEditor(), ArrayUtilRt.EMPTY_INT_ARRAY, false); IndentGuidesProvider provider = guidesProviderFactory.apply(myFixture); List<Guide> guides = provider.getGuides(); assertEquals("expected to find " + testData.myGuides.size() + " indent guides (" + testData.myGuides + ")" + "but got " + guides.size() + " (" + guides + ")", testData.myGuides.size(), guides.size()); Map<Pair<Integer, Integer>, Integer> guidesByLines = guides.stream() .collect(Collectors.toMap(i -> new Pair<>(i.getStartLine(), i.getEndLine()), i -> i.getIndent())); for (Guide expectedGuide : testData.myGuides) { Integer startLine = expectedGuide.getStartLine(); Integer endLine = expectedGuide.getEndLine(); Integer actualIndent = guidesByLines.get(new Pair<>(startLine, endLine)); assertNotNull("expected to find an indent guide at lines " + startLine + "-" + endLine, actualIndent); assertEquals("expected that indent guide descriptor at lines " + startLine + "-" + endLine + " has indent " + expectedGuide.getIndent() + " but got " + actualIndent, expectedGuide.getIndent(), actualIndent); } }