@Test
public void testHashCode() {

    Expression expression = new Expression("my.expression", "MYLANG");
    Attribute attribute = new Attribute("my.value", expression, "role1,role2", "myrenderer");
    Set<String> roles = new HashSet<String>();
    roles.add("role1");
    roles.add("role2");
    assertEquals(nullSafeHashCode("my.value")
            + nullSafeHashCode(expression) + nullSafeHashCode(roles)
            + nullSafeHashCode("myrenderer"), attribute.hashCode());
}