code: public Object[] cloneArray(Object[] array) {
          Class<?> clazz = array.getClass().getComponentType();
          Object newArray =  Array.newInstance(clazz, array.length);
          System.arraycopy(array, 0, newArray, 0, array.length);
          return (Object[]) newArray;
      }
docs: Clone the given array into a new instance of the same type and
  dimensions. The values are directly copied by memory, so this is not
  a deep clone operation.  However, manipulation of the contents of the
  array will not impact the given array.
  
  @param array The array to clone
  
  @return The new cloned array