CMLStack { String pop() { return stack[--sp]; }  @Override String toString();  }
@Test public void testPop() { CMLStack stack = new CMLStack(); stack.push("first"); stack.push("second"); stack.push("third"); Assert.assertEquals("third", stack.pop()); Assert.assertEquals("second", stack.pop()); Assert.assertEquals("first", stack.pop()); try { Assert.assertEquals("doesNotExist", stack.pop()); Assert.fail("Should have received an ArrayIndexOutOfBoundsException"); } catch (Exception exception) { } }