public static SqlNode[] cloneArray(SqlNode[] nodes) {
   SqlNode[] clones = (SqlNode[]) nodes.clone();
   for (int i = 0; i < clones.length; i++) {
     SqlNode node = clones[i];
     if (node != null) {
       clones[i] = (SqlNode) node.clone();
     }
   }
   return clones;
 }
 /**
  * Returns whether two nodes are equal (using {@link #equalsDeep(SqlNode,boolean)}) or are both
  * null.
  *
  * @param node1 First expression
  * @param node2 Second expression
  * @param fail Whether to throw {@link AssertionError} if expressions are not equal
  */
 public static boolean equalDeep(SqlNode node1, SqlNode node2, boolean fail) {
   if (node1 == null) {
     return node2 == null;
   } else if (node2 == null) {
     return false;
   } else {
     return node1.equalsDeep(node2, fail);
   }
 }