ListTemplatesCommand extends OsgiCommandSupport { @VisibleForTesting void setOut(PrintStream out) { this.out = checkNotNull(out, "out is null"); } ListTemplatesCommand(List<PoolTemplate> templates);   }
@Test public void testListTemplates() throws Exception { final ImmutableList<PoolTemplate> templates = ImmutableList.<PoolTemplate>of( XmlTemplate.newXmlTemplate(readDefaultTemplate("jenkins")), XmlTemplate.newXmlTemplate(readDefaultTemplate("cdh3"))); ListTemplatesCommand command = new ListTemplatesCommand(templates); command.setOut(out); command.execute(mock(CommandSession.class)); out.flush(); assertThat(outputStream.toString()).contains("jenkins").contains("cdh3"); }