@Test
public void testParseTileMatrix()
                        throws Exception {

    XMLStreamReader xmlStream = getResourceXmlStreamReader( "wmts100_tilematrix.xml" );
    ICRS crs = CRSManager.getCRSRef( "EPSG:26912" );
    assertEquals( START_ELEMENT, xmlStream.getEventType() );
    assertEquals( new QName( WMTS_100_NS, "TileMatrix" ), xmlStream.getName() );
    TileMatrix tileMatrix = adapter.parseTileMatrix( xmlStream, crs );
    assertEquals( END_ELEMENT, xmlStream.getEventType() );
    assertEquals( new QName( WMTS_100_NS, "TileMatrix" ), xmlStream.getName() );
    assertEquals( "tilematrix1", tileMatrix.getIdentifier() );
    assertEquals( 2.0, tileMatrix.getResolution(), 0.000000001 );
    assertEquals( 512, tileMatrix.getTilePixelsX() );
    assertEquals( 256, tileMatrix.getTilePixelsY() );
    assertEquals( 3, tileMatrix.getNumTilesX() );
    assertEquals( 4, tileMatrix.getNumTilesY() );
    SpatialMetadata spatialMetadata = tileMatrix.getSpatialMetadata();
    assertEquals( crs, spatialMetadata.getCoordinateSystems().get( 0 ) );
    assertEquals( 441174.0, spatialMetadata.getEnvelope().getMin().get0(), 0.0001 );
    assertEquals( 4453991.0, spatialMetadata.getEnvelope().getMin().get1(), 0.0001 );
    assertEquals( 444246.0, spatialMetadata.getEnvelope().getMax().get0(), 0.0001 );
    assertEquals( 4456039.0, spatialMetadata.getEnvelope().getMax().get1(), 0.0001 );
}