### Question:
AuthenticationUtilService { public boolean isUserInRole(String role) { role = StringUtils.trimToNull(role); if (role == null) return false; return httpRequest.isUserInRole(role); }  boolean isAuthenticatedUser(); Principal getAuthenticatedUserPrincipal(); boolean isUserInRole(String role); boolean isUserInAnyOfRoles(boolean acceptAdmin, String... roles); boolean isUserInAnyOfRoles(boolean acceptAdmin, Collection<String> roles); String getAuthenticatedProvider(); void checkProviderManagementPermission(String providerName); String getAuthenticatedContributor(boolean forceCreate); boolean updateAuthenticatedContributorProfile(); AuthenticatedUserType getAuthenticatedUserType(); Set<String> getUserRoles(); boolean isAuthenticatedUserOfType(AuthenticatedUserType userType);  }### Answer:
@Test public void isUserInRole() { AuthenticationUtilService tested = getTested(); Mockito.when(tested.httpRequest.isUserInRole(ROLE1)).thenReturn(false); Mockito.when(tested.httpRequest.isUserInRole(ROLE2)).thenReturn(true); { Assert.assertFalse(tested.isUserInRole(null)); Mockito.verifyZeroInteractions(tested.httpRequest); } { Assert.assertFalse(tested.isUserInRole("")); Mockito.verifyZeroInteractions(tested.httpRequest); } { Assert.assertFalse(tested.isUserInRole(" ")); Mockito.verifyZeroInteractions(tested.httpRequest); } { Assert.assertFalse(tested.isUserInRole(ROLE1)); Mockito.verify(tested.httpRequest).isUserInRole(ROLE1); } { Assert.assertTrue(tested.isUserInRole(ROLE2)); Mockito.verify(tested.httpRequest).isUserInRole(ROLE2); } }