/**
  * Returns a copy of the provided nodes list.
  *
  * @param <T> the actual nodes's type
  * @param nodes the nodes list to copy
  * @return a single node, representing a copy of the nodes list
  */
 public <T extends ASTNode> T copyRange(List<T> nodes) {
   if (nodes.isEmpty()) {
     return null;
   }
   if (!isValidForRangeCopy(nodes)) {
     throw new IllegalArgumentException(
         nodes.get(0), "The provided nodes are not valid for doing a range copy: " + nodes);
   }
   return refactorings.createCopyTarget(nodes.get(0), nodes.get(nodes.size() - 1));
 }
 /**
  * Returns a placeholder where to move the provided {@link ASTNode}.
  *
  * @param <T> the actual node type
  * @param nodeToMove the node to move
  * @return a placeholder for the moved node
  */
 public <T extends ASTNode> T move(T nodeToMove) {
   return refactorings.createMoveTarget(nodeToMove);
 }
 private boolean isValidForRangeCopy(List<? extends ASTNode> nodes) {
   return nodesHaveSameParentAndLocation(nodes) && refactorings.isValidRange(nodes);
 }
 /**
  * Returns a copy of the provided {@link ASTNode}.
  *
  * @param <T> the actual node type
  * @param nodeToCopy the node to copy
  * @return a copy of the node
  */
 public <T extends ASTNode> T copy(T nodeToCopy) {
   if (isValidInCurrentAST(nodeToCopy)) {
     return refactorings.createCopyTarget(nodeToCopy);
   }
   return copySubtree(nodeToCopy);
 }
 /**
  * Class constructor.
  *
  * @param refactorings the refactorings
  */
 public ASTBuilder(final Refactorings refactorings) {
   this.refactorings = refactorings;
   this.ast = refactorings.getAST();
 }