UserAuthenticationFactoryImpl implements UserAuthenticationFactory { @NotNull @Override public Authentication getAuthentication(@NotNull UserConfiguration userConfiguration, @NotNull Root root, @Nullable String userId) { return new UserAuthentication(userConfiguration, root, userId); }  @NotNull @Override Authentication getAuthentication(@NotNull UserConfiguration userConfiguration, @NotNull Root root, @Nullable String userId);  }
@Test public void testGetAuthentication() { Authentication authentication = factory.getAuthentication(getUserConfiguration(), root, userId); assertNotNull(authentication); assertTrue(authentication instanceof UserAuthentication); }