DefaultComponentRole implements ComponentRole<T> { @Override public boolean equals(Object object) { boolean result; if (this == object) { result = true; } else { if (object == null || object.getClass() != getClass()) { result = false; } else { ComponentRole<?> cr = (ComponentRole<?>) object; result = Objects.equals(getRoleType(), cr.getRoleType()) && Objects.equals(getRoleHint(), cr.getRoleHint()); } } return result; } DefaultComponentRole();  DefaultComponentRole(ComponentRole<T> componentRole);  DefaultComponentRole(Type roleType, String roleHint); @Override Type getRoleType(); void setRoleType(Type roleType); void setRoleHint(String roleHint); @Override String getRoleHint(); @Override String toString(); @Override boolean equals(Object object); @Override int hashCode(); @Deprecated void setRole(Class<T> role); @Override @Deprecated Class<T> getRole();  }
@Test void equals() { DefaultComponentRole cr1 = new DefaultComponentRole(); cr1.setRoleType(Role.class); cr1.setRoleHint("hint"); assertEquals(cr1, cr1); DefaultComponentRole cr2 = new DefaultComponentRole(); cr2.setRoleType(Role.class); cr2.setRoleHint("hint"); assertEquals(cr1, cr2); DefaultComponentRole cr3 = new DefaultComponentRole(); cr3.setRoleType(Role.class); cr3.setRoleHint("other"); assertFalse(cr1.equals(cr3)); DefaultComponentRole cr4 = new DefaultComponentRole(); cr4.setRoleType(OtherRole.class); cr4.setRoleHint("hint"); assertFalse(cr1.equals(cr4)); }