code: static <T> T[] copy(Object[] source, int from, int to, T[] arrayOfType) {
      T[] result = newArray(arrayOfType, to - from);
      System.arraycopy(source, from, result, 0, to - from);
      return result;
    }
docs: Equivalent to Arrays.copyOfRange(source, from, to, arrayOfType.getClass()).