public class StackLL implements StackIntf { private SingleLinkedList underlyingLL; public StackLL() { underlyingLL = new SingleLinkedList(); } @Override public boolean isEmpty() { return underlyingLL.isEmpty(); } @Override public S push(S e) { underlyingLL.addFirst(e); return e; } @Override public S peek() { return underlyingLL.first(); } @Override public S pop() { return underlyingLL.removeFirst(); } @Override public int size() { return underlyingLL.size(); } @Override public void clear() { underlyingLL = new SingleLinkedList(); } }