int (List<ASTNode> children, int startOffset) { int end = children.get(children.size() - 1).getTextRange().getEndOffset(); for (int i = 0; i < children.size(); i++) { ASTNode child = children.get(i); if (BasicJavaAstTreeUtil.is(child, JavaTokenType.RBRACE)) { int j = i - 1; while (BasicJavaAstTreeUtil.isWhiteSpace(children.get(j)) && children.get(j).getTextRange().getStartOffset() > startOffset) { j--; } end = children.get(j).getTextRange().getEndOffset(); } } return end; }