public ArrayDeque<E> clone(){
  try {
    @SuppressWarnings("unchecked") ArrayDeque<E> result=(ArrayDeque<E>)super.clone();
    result.elements=Arrays.copyOf(elements,elements.length);
    return result;
  }
 catch (  CloneNotSupportedException e) {
    throw new AssertionError();
  }
}

public ArrayDeque < E > clone ( ) { try { @ SuppressWarnings ( "unchecked" ) ArrayDeque < E > result = ( ArrayDeque < E > ) super . clone ( ) ; result . elements = Arrays . copyOf ( elements , elements . length ) ; return result ; } catch ( CloneNotSupportedException e ) { throw new AssertionError ( ) ; } }
returns a copy of this deque .
