String (@NotNull PsiElement firstElement, @NotNull PsiElement lastElement) { checkState(); PsiElement e; StringBuilder result = new StringBuilder(); for (e = firstElement; e != null && e != lastElement; e = e.getNextSibling()) { addIgnored(e); result.append(e.getText()); } if (e == null) { throw new IllegalArgumentException("Elements must be siblings: " + firstElement + " and " + lastElement); } addIgnored(lastElement); result.append(lastElement.getText()); return result.toString(); }