code: protected String popOrNull(Stack<String> stack) {
          if (stack != null && !stack.isEmpty()) {
              return stack.pop();
          } else {
              return null;
          }
      }
docs: Return the top level element of the the given stack or <code>null</code> if the stack
  is empty
  
  @param stack stack to examine
  @return null or top element