@Test
public void writeThemeFull()
                        throws Exception {

    final ByteArrayOutputStream bos = new ByteArrayOutputStream();
    final XMLStreamWriter writer = newInstance().createXMLStreamWriter( bos );
    writer.writeStartElement( "Layer" );
    writer.writeNamespace( "", WMSNS );
    writer.writeNamespace( "xlink", XLNNS );
    XMLAdapter.writeElement( writer, "Title", "Container" );
    final LayerMetadata layerMetadata = createLayerMetadata();
    final DatasetMetadata datasetMetadata = createDatasetMetadataFull();
    final DoublePair scaleDenominators = new DoublePair( 0.0, 999999.9 );
    final Map<String, String> authorityNameToUrl = createAuthorityNameToUrlMap();
    themeWriter.writeTheme( writer, layerMetadata, datasetMetadata, authorityNameToUrl, scaleDenominators, null );
    writer.writeEndElement();
    writer.flush();
    bos.close();
    final InputStream is = WmsCapabilities130ThemeWriterTest.class.getResourceAsStream( "wms130_layer_full.xml" );
    final byte[] expected = IOUtils.readBytesAndClose( is, -1 );
    assertValidity( new ByteArrayInputStream( bos.toByteArray() ), SCHEMA_URL );
    assertArrayEquals( expected, bos.toByteArray() );
}