SemanticContext { public Environment pop() { Objects.requireNonNull(environment, "Fail to pop context due to no environment present"); Environment curEnv = environment; environment = curEnv.getParent(); return curEnv; }  void push(); Environment peek(); Environment pop();  }
@Test public void popRootEnvironmentShouldPass() { context.pop(); }
@Test(expected = NullPointerException.class) public void popEmptyEnvironmentStackShouldFail() { context.pop(); context.pop(); }