public final void pop(int type) {
public final int pop() {
    public final void pop(int type) {        if (tos <= 0) { throw new Error("Stack is empty"); }        if (stack[ --tos] != type) { throw new Error("TypeStack[" + tos                + "] is not the expected element " + type + " but "                + stack[ tos]); }    }