@Test
public void testToJson() {

    final Rule allowsDigits = new Rule(RuleType.ALLOW, Pattern.compile("[0-9]*"));
    assertEquals("expect json", key(Rule.keys().type(), "ALLOW")
            .key(Rule.keys().pattern(), "[0-9]*").get(), allowsDigits.toJson());
}