code: @Override
      public void endElement(String uri, String localName, String qName) throws SAXException {
  
          // <context-param>
          if (elements("web-app", "context-param")) {
              if (currentName != null && currentValue != null) {
                  entries.put(currentName, currentValue);
              }
          }
  
          // remove the element from the stack
          String removedName = stack.pop();
  
          // check if the removed name is the expected one
          if (!removedName.equals(localName)) {
              throw new IllegalStateException("Found '" + removedName + "' but expected '" + localName + "' on the stack!");
          }
  
      }
docs: /*
  @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String)