AnonSecurityContext implements SecurityContext { @Override public boolean isUserInRole(String role) { return false; } AnonSecurityContext();  AnonSecurityContext(boolean secure); @Override Principal getUserPrincipal(); @Override boolean isUserInRole(String role); @Override boolean isSecure(); @Override String getAuthenticationScheme();  }
@Test public void isUserInRole_ShouldNeverBeInRole() { assertFalse(new AnonSecurityContext().isUserInRole(null)); assertFalse(new AnonSecurityContext().isUserInRole("")); assertFalse(new AnonSecurityContext().isUserInRole("user")); assertFalse(new AnonSecurityContext().isUserInRole("admin")); }