SitemapWriter { public void writeGenes(OutputStream outputStream, Collection<String> various, Collection<String> genes) throws XMLStreamException { List<String> urls = new ArrayList<>(); urls.addAll(various.stream().map(s -> OUR_ADDRESS + s).collect(toImmutableList())); urls.addAll(genes.stream().map(s -> OUR_ADDRESS + "/genes/" + s).collect(toImmutableList())); writeDocument(outputStream, urls, "urlset", "url", ImmutableMap.of("changefreq", "monthly")); }  void writeSitemapIndex(OutputStream outputStream,
                                  Collection<SpeciesProperties> speciesProperties); void writeGenes(OutputStream outputStream, Collection<String> various, Collection<String> genes);  }
@Test public void testWriteOneGene() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); subject.writeGenes(baos, Lists.newArrayList(), Lists.newArrayList("ASPM")); assertThat( baos.toString(Charset.defaultCharset()), containsString( "<url><loc>http: }