code: public static Rule getRule(final Stack stack) {
      if (stack.size() < 2) {
        throw new IllegalArgumentException(
          "Invalid NOT EQUALS rule - expected two parameters but received "
          + stack.size());
      }
  
      String p2 = stack.pop().toString();
      String p1 = stack.pop().toString();
  
      if (p1.equalsIgnoreCase(LoggingEventFieldResolver.LEVEL_FIELD)) {
          return NotLevelEqualsRule.getRule(p2);
      } else {
          return new NotEqualsRule(p1, p2);
      }
    }
docs: Get new instance from top two elements of stack.
  @param stack stack.
  @return new instance.