### Question:
AgentPids { public static PID forSoftware(SoftwareAgent agent) { Objects.requireNonNull(agent, "Agent must not be null"); return PIDs.get(PIDConstants.AGENTS_QUALIFIER, SOFTWARE_AGENT_DOMAIN + "/" + agent.getFullname()); } private  AgentPids(); static PID forSoftware(SoftwareAgent agent); static PID forSoftware(String name); static PID forPerson(String username); static PID forPerson(AgentPrincipals princ); static final String SOFTWARE_AGENT_DOMAIN; static final String PERSON_AGENT_DOMAIN; static final String ONYEN_DOMAIN; }### Answer:
@Test public void pidForSoftwareAgent() throws Exception { assertEquals(BASE_URI + "agents/software/bxc-services-5.x", AgentPids.forSoftware(SoftwareAgent.servicesAPI).getRepositoryPath()); assertEquals("agents/software/bxc-services-5.x", AgentPids.forSoftware(SoftwareAgent.servicesAPI).getQualifiedId()); assertEquals("software/bxc-services-5.x", AgentPids.forSoftware(SoftwareAgent.servicesAPI).getId()); }
@Test(expected = NullPointerException.class) public void pidForNullSoftwareAgent() throws Exception { AgentPids.forSoftware((SoftwareAgent) null); }
@Test public void pidForSoftwareName() throws Exception { assertEquals(BASE_URI + "agents/software/useful-software", AgentPids.forSoftware("useful-software").getRepositoryPath()); }
@Test(expected = NullPointerException.class) public void pidForNullSoftwareName() throws Exception { AgentPids.forSoftware((String) null); }