@Test public void testPush() { int i = 0; do { ss.push("Hello #" + i++); } while (((MyStack<String>) ss).hasRoom()); assertEquals(i, MyStack.DEFAULT_INITIAL); }
@Override public void push(T obj) { stack[depth++] = obj; }
MyStack implements SimpleStack<T> { @Override public void push(T obj) { stack[depth++] = obj; } }
MyStack implements SimpleStack<T> { @Override public void push(T obj) { stack[depth++] = obj; } MyStack();  MyStack(int howBig); }
MyStack implements SimpleStack<T> { @Override public void push(T obj) { stack[depth++] = obj; } MyStack();  MyStack(int howBig); @Override boolean empty(); @Override void push(T obj); @Override T pop(); @Override T peek(); boolean hasNext(); boolean hasRoom(); int getStackDepth(); }
MyStack implements SimpleStack<T> { @Override public void push(T obj) { stack[depth++] = obj; } 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; }