### Question:
AuthenticatedUserUtil { public static AuthenticatedUser createFromString(String user) { switch (user) { case AuthenticatedUser.SYSTEM_USERNAME: return AuthenticatedUser.SYSTEM_USER; case AuthenticatedUser.ANONYMOUS_USERNAME: return AuthenticatedUser.ANONYMOUS_USER; default: return new AuthenticatedUser(user); } } private  AuthenticatedUserUtil(); static AuthenticatedUser createFromString(String user);  }### Answer:
@Test public void testSuper() { AuthenticatedUser user = AuthenticatedUserUtil.createFromString("system"); assertThat(user).isSameAs(AuthenticatedUser.SYSTEM_USER); assertThat(user.isSystem()).isTrue(); }
@Test public void testAnonymous() { AuthenticatedUser user = AuthenticatedUserUtil.createFromString("anonymous"); assertThat(user).isSameAs(AuthenticatedUser.ANONYMOUS_USER); assertThat(user.isAnonymous()).isTrue(); }
@Test public void testCustomUser() { AuthenticatedUser user = AuthenticatedUserUtil.createFromString("Bob"); assertThat(user.getName()).isEqualTo("Bob"); assertThat(user.getPrimaryRole()).isEqualTo(RoleResource.role("Bob")); }