public Integer pop() { if (empty()) { return null; } Integer i = headOfStack.getValue(); headOfStack = headOfStack.getNextElement(); return i; }