### Question:
ObjectStack { public Object peek() { if (size() == 0) { throw new EmptyStackException(); } int lastIndex = collection.size() - 1; Object returnValue = collection.get(lastIndex); return returnValue; } ObjectStack(); boolean isEmpty(); int size(); void push(Object value); Object pop(); Object peek(); void clear();  }### Answer:
@Test void testPeekWithEmptyStack() { assertThrows(EmptyStackException.class, () -> createStackWithNElements(0).peek()); }
@Test void testPeekWithNonEmptyStack() { ObjectStack stack = createStackWithNElements(5); for (int value = 10; value >= 0; --value) { assertEquals(4, stack.peek()); } }