### Question:
ServiceAgentGenerator { public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least " + PW_MIN_LENGTH + " signs long, but only " + argv[0].length() + " given"); return; } try { ServiceAgentImpl agent = ServiceAgentImpl.createServiceAgent(ServiceNameVersion.fromString(argv[0]), argv[1]); System.out.print(agent.toXmlString()); } catch (Exception e) { System.err.println("unable to generate new agent: " + e); } }  static void main(String argv[]);  }### Answer:
@Test public void testMainUsage() { ServiceAgentGenerator.main(new String[0]); assertTrue(("" + standardError.toString()).contains("usage:")); assertEquals("", standardOut.toString()); }
@Test public void testMainNormal() { String className = "a.test.package.WithAService@1.0"; ServiceAgentGenerator.main(new String[] { className, "mypass" }); assertEquals("", standardError.toString()); String output = standardOut.toString(); assertTrue(output.contains("serviceclass=\"" + className + "\"")); }