### Question:
JwtRememberMeServices extends AbstractRememberMeServices { @Override protected UserDetails processAutoLoginCookie(@Nonnull final String[] tokens, @Nonnull final HttpServletRequest request, @Nonnull final HttpServletResponse response) { final Collection<? extends GrantedAuthority> authorities = tokens.length > 1 ? generateAuthorities(tokens[1]) : Collections.emptySet(); return new User(tokens[0], "", authorities); } JwtRememberMeServices(@Nonnull final JwtProperties properties);   }### Answer:
@Test public void processAutoLoginCookie() throws Exception { final UserDetails user = service.processAutoLoginCookie(new String[]{"dladmin", groupPrincipalsJson("admin")}, Mockito.mock(HttpServletRequest.class), Mockito.mock(HttpServletResponse.class)); Assert.assertEquals("dladmin", user.getUsername()); Principal group = user.getAuthorities().stream() .findAny() .map(JaasGrantedAuthority.class::cast) .map(ja -> ja.getPrincipal()) .orElseThrow(() -> new AssertionError("No group principal found")); Assert.assertEquals(new GroupPrincipal("admin"), group); }