@Nullable
  public ELEMENTTYPE replaceTopElement (@Nullable final ELEMENTTYPE aItem)
  {
    if (isEmpty ())
      throw new EmptyStackException ();
    setLast (aItem);
    return aItem;
  }
@ Nullable public ELEMENTTYPE replaceTopElement ( @ Nullable final ELEMENTTYPE aItem ) { if ( isEmpty ( ) ) throw new EmptyStackException ( ) ; setLast ( aItem ) ; return aItem ; }
Replaces the top element in the stack. This is a shortcut for
<code>pop (); push (aItem);</code>

@param aItem
the item to be pushed onto this stack.
@return the <code>aItem</code> argument.
@throws EmptyStackException
if the stack is empty