code: public static @NotNull Object[] copy(@NotNull Object array) {
      return copyToList(checkNotNull(array)).toArray();
    }
docs: Copies the contents of the given array into an array of objects.
  
  @param array the array to copy.
  @return an array of objects containing the contents of the array.
  @throws NullPointerException     if the given object is {@code null}.
  @throws IllegalArgumentException if the given object is not an array.