void (@NotNull String psiTree, @NotNull String reparsedTree) { if (!psiTree.equals(reparsedTree)) { String[] psiLines = StringUtil.splitByLinesDontTrim(psiTree); String[] reparsedLines = StringUtil.splitByLinesDontTrim(reparsedTree); for (int i = 0; ; i++) { if (i >= psiLines.length || i >= reparsedLines.length || !psiLines[i].equals(reparsedLines[i])) { psiLines[Math.min(i, psiLines.length - 1)] += " // in PSI structure"; reparsedLines[Math.min(i, reparsedLines.length - 1)] += " // re-created from text"; break; } } psiTree = StringUtil.join(psiLines, "\n"); reparsedTree = StringUtil.join(reparsedLines, "\n"); Assert.assertEquals(reparsedTree, psiTree); } }