### Question:
AuthenticationUtil { public static void clearAuthentication() { SecurityContextHolder.getContext().setAuthentication(null); } private  AuthenticationUtil(); static void clearAuthentication(); static void configureAuthentication(String role);  }### Answer:
@Test public void clearAuthentication_ShouldRemoveAuthenticationFromSecurityContext() { Authentication authentication = createAuthentication(); SecurityContextHolder.getContext().setAuthentication(authentication); AuthenticationUtil.clearAuthentication(); Authentication currentAuthentication = SecurityContextHolder.getContext().getAuthentication(); assertThat(currentAuthentication).isNull(); }