public static Rule getRule(final String inequalitySymbol, final Stack<Object> stack) {
    if (stack.size() < 2) {
      throw new IllegalArgumentException("Invalid " + inequalitySymbol + " rule - expected two parameters but received " + stack.size());
    }

    String p2 = stack.pop().toString();
    String p1 = stack.pop().toString();
    return getRule(inequalitySymbol, p1, p2);
  }
Create new instance from top two elements on stack.

@param inequalitySymbol inequality symbol.
@param stack            stack.
@return rule.
olv-core/src/main/java/pl/otros/logview/accept/query/org/apache/log4j/rule/InequalityRule.java