void () { var file = myFixture.configureByText("a.txt", "abbbc"); var f1 = psiFragment(file, 0, 1); var f2 = psiFragment(file, 4, 5).markUnknown(new TextRange(1, 1)); var joined = TextContent.joinWithWhitespace(' ', List.of(f1, f2)); assertNotNull(joined); assertEquals("a c|", unknownOffsets(joined)); assertEquals(List.of(0, 1, 4, 5), IntStreamEx.range(4).mapToObj(joined::textOffsetToFile).toList()); assertEquals("a |", unknownOffsets(joined.markUnknown(new TextRange(2, 3)))); assertEquals("a |", unknownOffsets(joined.excludeRange(new TextRange(2, 3)))); assertEquals("a|c|", unknownOffsets(joined.markUnknown(new TextRange(1, 2)))); assertEquals("ac|", unknownOffsets(joined.excludeRange(new TextRange(1, 2)))); assertEquals("| c|", unknownOffsets(joined.markUnknown(new TextRange(0, 1)))); assertEquals("c|", unknownOffsets(joined.excludeRange(new TextRange(0, 1)))); assertEquals(joined, TextContent.joinWithWhitespace(' ', List.of(f1, f2))); }