AuthenticationInfo implements JsonSerializable { public List<String> getRoles() { return roles; } AuthenticationInfo();  AuthenticationInfo(String user);  AuthenticationInfo(String user, String roles, String ticket); String getUser(); void setUser(String user); List<String> getRoles(); void setRoles(List<String> roles); void setRoles(String roles); List<String> getUsersAndRoles(); String getTicket(); void setTicket(String ticket); UserCredentials getUserCredentials(); void setUserCredentials(UserCredentials userCredentials); static boolean isAnonymous(AuthenticationInfo subject); boolean isAnonymous(); @Override String toJson(); static AuthenticationInfo fromJson(String json); static final AuthenticationInfo ANONYMOUS; }
@Test public void testRoles() { final String roles = "[\"role1\", \"role2\", \"role with space\"]"; final AuthenticationInfo authenticationInfo = new AuthenticationInfo("foo", roles, "bar"); assertEquals( new ArrayList<>(Arrays.asList("role1", "role2", "role with space")), authenticationInfo.getRoles()); }