### Question:
Role extends BaseChangeableOpenmrsMetadata { public boolean hasPrivilege(String privilegeName) { if (RoleConstants.SUPERUSER.equals(this.role)) { return true; } if (privileges != null) { for (Privilege p : privileges) { if (p.getPrivilege().equals(privilegeName)) { return true; } } } return false; } Role();  Role(String role);  Role(String role, String description); Set<Privilege> getPrivileges(); void setPrivileges(Set<Privilege> privileges); @Override String getName(); void addPrivilege(Privilege privilege); void removePrivilege(Privilege privilege); String getRole(); void setRole(String role); @Override String toString(); boolean hasPrivilege(String privilegeName); Set<Role> getInheritedRoles(); void setInheritedRoles(Set<Role> inheritedRoles); boolean inheritsRoles(); Set<Role> getAllParentRoles(); Set<Role> recurseOverParents(final Set<Role> total); @Override Integer getId(); @Override void setId(Integer id); Set<Role> getChildRoles(); void setChildRoles(Set<Role> childRoles); boolean hasChildRoles(); Set<Role> getAllChildRoles(); Set<Role> recurseOverChildren(final Set<Role> total); static final long serialVersionUID; }### Answer:
@Test public void hasPrivilege_shouldNotFailGivenNullParameter() { Role role = new Role(); role.hasPrivilege(null); }
@Test public void hasPrivilege_shouldReturnFalseIfNotFound() { Role role = new Role(); assertFalse("This roles should not have the privilege", role.hasPrivilege("some other privilege name")); }