ExistsRule extends AbstractRule { public static Rule getRule(final String field) { return new ExistsRule(field); } private  ExistsRule(final String fld); static Rule getRule(final String field); static Rule getRule(@SuppressWarnings("rawtypes") final Stack stack); @SuppressWarnings({"rawtypes", "unchecked"}) boolean evaluate(final LogData event, Map matches);  }
@Test public void test1() { Stack<Object> stack = new Stack<>(); try { ExistsRule.getRule(stack); Assert.fail("Should have thrown IllegalArgumentException"); } catch (IllegalArgumentException ignored) { } }
@Test public void test2() { Stack<Object> stack = new Stack<>(); stack.push("Hello"); try { ExistsRule.getRule(stack); Assert.fail("Should have thrown IllegalArgumentException"); } catch (IllegalArgumentException ignored) { } }