### Question:
Stack { public T pop() { return list.removeLast(); }  void push(T o); T pop(); T replaceTop(T value); T peek(); boolean isEmpty(); int size(); List<T> getList(); static final Stack EMPTY; }### Answer:
@Test public void testPop() throws Exception { stack.push("a"); stack.push("b"); stack.push("c"); stack.pop(); ReflectionAssert.assertReflectionEquals(new String[]{"a", "b"}, stack.getList().toArray()); stack.pop(); ReflectionAssert.assertReflectionEquals(new String[]{"a"}, stack.getList().toArray()); stack.pop(); ReflectionAssert.assertReflectionEquals(new String[]{}, stack.getList().toArray()); }
@Test(expectedExceptions = NoSuchElementException.class) public void testPop_emptyStack() throws Exception { stack.pop(); }