### Question:
Stack { public T peek() { return list.getLast(); }  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 testPeek() throws Exception { stack.push("a"); assertEquals(stack.peek(), "a"); stack.push("b"); assertEquals(stack.peek(), "b"); stack.push("c"); assertEquals(stack.peek(), "c"); assertEquals(stack.peek(), "c"); stack.pop(); assertEquals(stack.peek(), "b"); stack.pop(); assertEquals(stack.peek(), "a"); }
@Test(expectedExceptions = NoSuchElementException.class) public void testPeek_emptyStack() throws Exception { stack.peek(); }