@Test
    public void test2() {
	Stack<Object> stack = new Stack<>();
	stack.push("Hello");
	stack.push("World");
	try {
	    AndRule.getRule(stack);
	    Assert.fail("Should have thrown IllegalArgumentException");
	} catch (IllegalArgumentException ex) {
	  //success
  }
    }
AndRule.getRule(Stack) throws exception if non-rules are provided.
olv-core/src/test/java/pl/otros/logview/accept/query/org/apache/log4j/rule/AndRuleTest.java