MyStack implements SimpleStack<T> { public boolean hasRoom() { return depth < stack.length; } 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 testHasRoom() { MyStack<Object> s = new MyStack<Object>(1); assertTrue(s.hasRoom()); s.push(new Object()); assertFalse(s.hasRoom()); }