CallStack { public void exit(final Resource resource) { stack.remove(resource); }  void enter(final Resource resource); void exit(final Resource resource); @Override String toString();  }
@Test public void testExit() { final CallStack callStack = new CallStack(); callStack.enter(resource1); callStack.enter(resource2); callStack.exit(resource2); callStack.exit(resource1); }