### Question:
CertificateAuthenticationProvider implements AuthenticationProvider { @Override public Authentication authenticate(Authentication authentication) { authentication.setAuthenticated(true); return authentication; }  @Override Authentication authenticate(Authentication authentication); @Override boolean supports(Class<?> authentication);  }### Answer:
@Test void authenticate() { CertificateAuthenticationProvider cap = new CertificateAuthenticationProvider(); Authentication authentication = mock(Authentication.class); cap.authenticate(authentication); verify(authentication, times(1)).setAuthenticated(true); }