void () { TextRange fragment1 = new TextRange(0, 3); TextRange fragment2 = new TextRange(6, 9); var file = myFixture.configureByText("a.txt", "aaabbbccc"); TextContent text = TextContent.join(List.of(psiFragment(file, 0, 3), psiFragment(file, 6, 9))); for (int i = 0; i < file.getTextLength(); i++) { for (int j = i; j < file.getTextLength(); j++) { TextRange range = new TextRange(i, j); assertEquals(text.intersectsRange(range), range.intersectsStrict(fragment1) || range.intersectsStrict(fragment2)); } } }