budget/src/main/java/budget/backend/structures/LimitedStack.java
public E push(E o)
  {
    stack.addFirst(o);
    if (limit > 0 && size() > limit)
      stack.removeLast();
    return o;
  }
/**
   * push a new object to the stack and maintain the limit if necessary
   * @param o
   * @return the object that has been pushed to the stack
   */
push a new object to the stack and maintain the limit if necessary
@param o
@return the object that has been pushed to the stack
push a new object to the stack and maintain the limit if necessary @param o @return the object that has been pushed to the stack
public E push(E o)
  {
    stack.addFirst(o);
    if (limit > 0 && size() > limit)
      stack.removeLast();
    return o;
  }
public E push ( E o ) { stack . addFirst ( o ) ; if ( limit > 0 && size ( ) > limit ) stack . removeLast ( ) ; return o ; }
push a new object to the stack and maintain the limit if necessary
 @param o
 @return the object that has been pushed to the stack
push a new object to the stack and maintain the limit if necessary @param o @return the object that has been pushed to the stack