code: public static <T> void moveList(List<T> fromList, List<T> toList) {
      for (Iterator<T> iter = fromList.iterator(); iter.hasNext(); ) {
        T elem = iter.next();
        iter.remove();
        toList.add(elem);
      }
    }
docs: Moves nodes from one list to another, ensuring that they are not
  double-parented in the process.