void (PsiElement parent, PsiFile file) { int parentOffset = parent.getTextRange().getStartOffset(); int childOffset = 0; ASTNode child = parent.getNode().getFirstChildNode(); if (child != null) { while (child != null) { int childLength = checkChildRangeConsistency(file, parentOffset, childOffset, child); childOffset += childLength; child = child.getTreeNext(); } assertEquals(childOffset, parent.getTextLength()); } }