code: public static Object[] copyArray(Object[] array, int from, int to) {
      Object[] result = new Object[to - from];
      System.arraycopy(array, from, result, 0, to - from);
      return result;
    }
docs: (Partial) replacement for Arrays.copyOfRange, which is only available in JDK6.