docs: public static int[] copyOf(int[] old, int length) {
      int[] newArray = new int[length];
      int minLength = Math.min(old.length, length);
      System.arraycopy(old, 0, newArray, 0, minLength);
      return newArray;
    }