@Test
public void testHashCode() {

    final Rule newAllow = new Rule(Rules.DEFAULT_ALLOW.getType(), Rules.DEFAULT_ALLOW.getPattern());
    assertEquals("hashCode(): DEFAULT_ALLOW should equal new rule with same params as DEFAULT_ALLOW",
            Rules.DEFAULT_ALLOW.hashCode(), newAllow.hashCode());
    assertNotEquals("hashCode(): DEFAULT_ALLOW should not equal new ALLOW rule with different pattern",
            Rules.DEFAULT_ALLOW.hashCode(), new Rule(Rules.DEFAULT_ALLOW.getType(), Pattern.compile("foo")).hashCode());
    assertNotEquals("hashCode(): DEFAULT_DENY should not equal new ALLOW rule with same params as DEFAULT_ALLOW",
            Rules.DEFAULT_DENY.hashCode(), newAllow.hashCode());
    assertNotEquals("hashCode(): DEFAULT_INCLUDE should not equal new ALLOW rule with same params as DEFAULT_ALLOW",
            Rules.DEFAULT_INCLUDE.hashCode(), newAllow.hashCode());
}