### Question:
DefaultAuthenticationTypeAccessor implements AuthenticationTypeAccessor { @Override public Optional<AuthenticationType> getAuthenticationType(Long id) { return AuthenticationType.getById(id); } @Autowired  DefaultAuthenticationTypeAccessor(AuthenticationTypeRepository authenticationTypeRepository); @Override Optional<AuthenticationTypeDetails> getAuthenticationTypeDetails(AuthenticationType authenticationType); @Override Optional<AuthenticationType> getAuthenticationType(Long id);  }### Answer:
@Test public void getAuthenticationTypeTest() { AuthenticationTypeRepository authenticationTypeRepository = Mockito.mock(AuthenticationTypeRepository.class); DefaultAuthenticationTypeAccessor authenticationTypeAccessor = new DefaultAuthenticationTypeAccessor(authenticationTypeRepository); assertEquals(AuthenticationType.DATABASE, authenticationTypeAccessor.getAuthenticationType(1L).get()); assertEquals(AuthenticationType.LDAP, authenticationTypeAccessor.getAuthenticationType(2L).get()); assertEquals(AuthenticationType.SAML, authenticationTypeAccessor.getAuthenticationType(3L).get()); assertFalse(authenticationTypeAccessor.getAuthenticationType(5L).isPresent()); }