code: static <T> T[] copy(Object[] source, int from, int to, T[] arrayOfType) {
      return Arrays.copyOfRange(source, from, to, (Class<? extends T[]>) arrayOfType.getClass());
    }
docs: Equivalent to Arrays.copyOfRange(source, from, to, arrayOfType.getClass()).