code: @Nullable
      @SuppressWarnings("unchecked")
      protected <T extends JavaElement> ActiveElements<T> popIfActive() {
          return (ActiveElements<T>) (!activations.isEmpty() && activations.peek().depth == depth ? activations.pop() :
              null);
      }
docs: Pops the top of the stack of active elements if the current position in the call stack corresponds to the one
  that pushed the active elements.
  
  <p>This method does not do any type checks, so take care to retrieve the elements with the same types used to push
  to them onto the stack.
  
  @param <T> the type of the elements
  
  @return the active elements or null if the current call stack did not push any active elements onto the stack