### Question:
AgentPrincipals { public static AgentPrincipals createFromThread() { return GroupsThreadStore.getAgentPrincipals(); } AgentPrincipals(String username, AccessGroupSet principals); static AgentPrincipals createFromThread(); String getUsername(); String getUsernameUri(); AccessGroupSet getPrincipals();  }### Answer:
@Test public void testCreateFromThread() { GroupsThreadStore.storeUsername(USERNAME); GroupsThreadStore.storeGroups(PRINCIPAL_SET); AgentPrincipals agent = AgentPrincipals.createFromThread(); assertEquals(USERNAME, agent.getUsername()); assertTrue(agent.getPrincipals().containsAll(PRINCIPAL_LIST)); GroupsThreadStore.clearStore(); }