code: public static <U> U[] copyOf(U[] objectArray) {
  
      	Class<?> arrayClass = objectArray.getClass();
          @SuppressWarnings("unchecked") Class<U> componentClass = (Class<U>) arrayClass.getComponentType();
  
          @SuppressWarnings("unchecked") U[] copy = (U[]) Array.newInstance(componentClass, objectArray.length);
          System.arraycopy(objectArray, 0, copy, 0, objectArray.length);
          return copy;
      }
docs: This method does a similar job to JSE 6.0's Arrays.copyOf() method
  @param <U> The type of input array
  @param objectArray The array to copy
  @return A copy of the input, of component type U