Stack { public E pop() { if (mSize == 0) { throw new EmptyStackException(); } return mElements.set(--mSize, null); } Stack(); void push(E ele); E pop(); E peek(); E get(int index); E set(int index, E value); E remove(int index); int size(); boolean isEmpty(); void clear();  }
@Test public void testIllegalPop() throws Exception { Assertions.assertThrows(EmptyStackException.class, () -> { Stack<String> stack = new Stack<String>(); stack.pop(); }); }