class UnsyncStack<E> extends ArrayList<E> {
  
  /** Generated automatically. */
  private static final long serialVersionUID = -4984830372178073605L;

  UnsyncStack() {
  }

  /**
   * Pushes an item onto the top of this stack. This has exactly the same effect
   * as: {@code add(item)}
   * 
   * @param item the item to be pushed onto this stack.
   * @return the <code>item</code> argument.
   * @see ArrayList#add
   */
  public E push(E item) {
    add(item);
    return item;
  }

  /**
   * Removes the object at the top of this stack and returns that object as the
   * value of this function.
   * 
   * @return The object at the top of this stack (the last item of the
   *         <tt>ArrayList</tt> object).
   * @exception EmptyStackException if this stack is empty.
   */
  public E pop() {
    E obj;
    int len = size();
    obj = peek();
    remove(len - 1);
    return obj;
  }

  /**
   * Looks at the object at the top of this stack without removing it from the
   * stack.
   * 
   * @return the object at the top of this stack (the last item of the
   *         <tt>ArrayList</tt> object).
   * @exception EmptyStackException if this stack is empty.
   */
  public E peek() {<FILL_FUNCTION_BODY>}

  /**
   * Tests if this stack is empty.
   * 
   * @return <code>true</code> if and only if this stack contains no items;
   *         <code>false</code> otherwise.
   */
  public boolean empty() {
    return size() == 0;
  }

  /**
   * Returns the 1-based position where an object is on this stack. If the
   * object <tt>o</tt> occurs as an item in this stack, this method returns the
   * distance from the top of the stack of the occurrence nearest the top of the
   * stack; the topmost item on the stack is considered to be at distance
   * <tt>1</tt>. The <tt>equals</tt> method is used to compare <tt>o</tt> to the
   * items in this stack.
   * 
   * @param o
   *          the desired object.
   * @return the 1-based position from the top of the stack where the object is
   *         located; the return value <code>-1</code> indicates that the object
   *         is not on the stack.
   */
  public int search(Object o) {
    int i = lastIndexOf(o);
    if (i >= 0) {
      return size() - i;
    }
    return -1;
  }
  
}

    int len = size();
    if (len == 0) {
      throw new EmptyStackException();
    }
    return get(len - 1);
  
<methods>public void <init>() ,public void <init>(int) ,public void <init>(Collection<? extends E>) ,public boolean add(E) ,public void add(int, E) ,public boolean addAll(Collection<? extends E>) ,public boolean addAll(int, Collection<? extends E>) ,public void clear() ,public java.lang.Object clone() ,public boolean contains(java.lang.Object) ,public void ensureCapacity(int) ,public boolean equals(java.lang.Object) ,public void forEach(Consumer<? super E>) ,public E get(int) ,public int hashCode() ,public int indexOf(java.lang.Object) ,public boolean isEmpty() ,public Iterator<E> iterator() ,public int lastIndexOf(java.lang.Object) ,public ListIterator<E> listIterator() ,public ListIterator<E> listIterator(int) ,public E remove(int) ,public boolean remove(java.lang.Object) ,public boolean removeAll(Collection<?>) ,public boolean removeIf(Predicate<? super E>) ,public void replaceAll(UnaryOperator<E>) ,public boolean retainAll(Collection<?>) ,public E set(int, E) ,public int size() ,public void sort(Comparator<? super E>) ,public Spliterator<E> spliterator() ,public List<E> subList(int, int) ,public java.lang.Object[] toArray() ,public T[] toArray(T[]) ,public void trimToSize() <variables>private static final java.lang.Object[] DEFAULTCAPACITY_EMPTY_ELEMENTDATA,private static final int DEFAULT_CAPACITY,private static final java.lang.Object[] EMPTY_ELEMENTDATA,transient java.lang.Object[] elementData,private static final long serialVersionUID,private int size