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;
  }
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 ; }
(Partial) replacement for Arrays.copyOfRange, which is only available in JDK6.