code: public static void copy(int[] x, int[] y) {
          if (x.length != y.length) {
              throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));
          }
  
          System.arraycopy(x, 0, y, 0, x.length);
      }
docs: Copy x into y.