private static void moveAllFollowing ( Node start , Node srcParent , Node destParent ) { for ( Node n = start . getNext ( ) ; n != null ; n = start . getNext ( ) ) { boolean isFunctionDeclaration = NodeUtil . isFunctionDeclaration ( n ) ; srcParent . removeChild ( n ) ; if ( isFunctionDeclaration ) { destParent . addChildToFront ( n ) ; } else { destParent . addChildToBack ( n ) ; } } }
Move all the child nodes following start in srcParent to the end of destParent s child list .