ThreadLocalStack { public T getOrError() { T item = get(); if (item == null) { throw new NoSuchElementException(); } return item; }  T push(T item); T peek(); T pop(); T popOrError(); T get(); T getOrError(); void set(T item); void remove(); void with(T item, WithProcedure procedure);  }
@Test(expected = NoSuchElementException.class) public void getOrError() { stack.pop(); stack.getOrError(); }