### Question:
User extends BaseChangeableOpenmrsMetadata implements java.io.Serializable, Attributable<User> { public boolean hasRole(String r) { return hasRole(r, false); } User();  User(Integer userId);  User(Person person); boolean isSuperUser(); boolean hasPrivilege(String privilege); boolean hasRole(String r); boolean hasRole(String r, boolean ignoreSuperUser); boolean containsRole(String roleName); Collection<Privilege> getPrivileges(); Set<Role> getAllRoles(); Set<Role> getRoles(); void setRoles(Set<Role> roles); User addRole(Role role); User removeRole(Role role); @Override List<User> findPossibleValues(String searchText); @Override List<User> getPossibleValues(); @Override User hydrate(String userId); @Override String serialize(); @Override String getDisplayString(); String getSystemId(); void setSystemId(String systemId); Integer getUserId(); void setUserId(Integer userId); Person getPerson(); void setPerson(Person person); String getUsername(); void setUsername(String username); @Override String toString(); Map<String, String> getUserProperties(); void setUserProperties(Map<String, String> userProperties); void setUserProperty(String prop, String value); void removeUserProperty(String prop); String getUserProperty(String prop); String getUserProperty(String prop, String defaultValue); void addName(PersonName name); PersonName getPersonName(); String getGivenName(); String getFamilyName(); Set<PersonName> getNames(); List<Locale> getProficientLocales(); @Override Integer getId(); @Override void setId(Integer id); static final long serialVersionUID; }### Answer:
@Test public void hasRole_shouldHaveRole() { assertTrue(user.hasRole("Some Role")); }
@Test public void hasRole_shouldNotHaveRole() { assertFalse(user.hasRole("Not A Role")); }