MyStack implements SimpleStack<T> { @Override public T pop() { --depth; T tmp = stack[depth]; stack[depth] = null; return tmp; } MyStack();  MyStack(int howBig); @Override boolean empty(); @Override void push(T obj); @Override T pop(); @Override T peek(); boolean hasNext(); boolean hasRoom(); int getStackDepth(); static final int DEFAULT_INITIAL; }
@Test public void testPop() { ss.push("Yowza"); assertEquals(1, ((MyStack<String>) ss).getStackDepth()); assertSame("Yowza", ss.pop()); }
@Test(expected=ArrayIndexOutOfBoundsException.class) public void testPopUnderflow() { ss.pop(); }