void (@NotNull String rawStringLiteral, Pair<TextRange, String> @NotNull ... fragments) { final List<Pair<TextRange, String>> actual = createStringLiteralFromText(rawStringLiteral).getTextFragments(); final List<Pair<TextRange, String>> expected = Arrays.asList(fragments); assertEquals(expected, actual); for (Pair<TextRange, String> fragment : fragments) { final TextRange range = fragment.getFirst(); final String unescaped = range.substring(rawStringLiteral); if (!unescaped.contains("\\")) { final String escaped = fragment.getSecond(); assertEquals(String.format("Bad range %s: fragment without escaping differs after decoding", range), escaped, unescaped); } } }