TreeElement (TreeElement first, ASTNode last, ASTNode anchor, Boolean beforeB) { TreeElement firstAppended = null; boolean before = beforeB == null || beforeB.booleanValue(); try { TreeElement next; do { next = first.getTreeNext(); if (firstAppended == null) { firstAppended = getImpl().addInternal(first, anchor, before); anchor = firstAppended; } else { anchor = getImpl().addInternal(first, anchor, false); } } while (first != last && (first = next) != null); } finally { clearCaches(); } return firstAppended; }