@Test
public void writeThemeMinimal()
                        throws Exception {

    final ByteArrayOutputStream bos = new ByteArrayOutputStream();
    final XMLStreamWriter writer = newInstance().createXMLStreamWriter( bos );
    writer.writeStartElement( "Layer" );
    XMLAdapter.writeElement( writer, "Title", "Container" );
    final LayerMetadata layerMetadata = createLayerMetadataMinimal();
    layerMetadata.setQueryable( false );
    final DatasetMetadata datasetMetadata = createDatasetMetadataMinimal();
    final Map<String, String> authorityNameToUrl = emptyMap();
    themeWriter.writeTheme( writer, layerMetadata, datasetMetadata, authorityNameToUrl, null, null );
    writer.writeEndElement();
    writer.flush();
    bos.close();
    final InputStream is = WmsCapabilities111ThemeWriterTest.class.getResourceAsStream( "wms111_layer_minimal.xml" );
    final byte[] expected = IOUtils.readBytesAndClose( is, -1 );
    assertArrayEquals( expected, bos.toByteArray() );
}