public void push(int in) { if (!isEmpty() && in > top()) totalRejected++; else super.push(in); }
public int pop() { while (!isEmpty()) temp.push(super.pop()); int ret = temp.pop(); while (!temp.isEmpty()) push(temp.pop()); return ret; }