@SuppressWarnings("unchecked")
@Test
public void testParse()
                        throws Exception {

    GetMapParser getMapXMLAdapter = new GetMapParser();
    XMLStreamReader xmlStreamReader = createXmlStreamReader( "wms-1.3.0-GetMap.xml" );
    GetMap getMap = getMapXMLAdapter.parse( xmlStreamReader );
    LinkedList<LayerRef> layers = getMap.getLayers();
    assertThat( layers.size(), is( 3 ) );
    assertThat( layers, hasLayerRef( "municipalities" ) );
    assertThat( layers, hasLayerRef( "counties" ) );
    assertThat( layers, hasLayerRef( "zipcodes" ) );
    LinkedList<StyleRef> styles = getMap.getStyles();
    assertThat( styles.size(), is( 3 ) );
    assertThat( styles, hasStyleRef( "Municipalities" ) );
    assertThat( styles, hasStyleRef( "CountyBoundary" ) );
    assertThat( styles, hasStyleRef( "default" ) );
    assertThat( getMap.getWidth(), is( 1024 ) );
    assertThat( getMap.getHeight(), is( 512 ) );
    assertThat( getMap.getFormat(), is( "image/png" ) );
    assertThat( getMap.getTransparent(), is( true ) );
    assertThat( getMap.getBgColor(), is( BLACK ) );
    assertThat( getMap.getCoordinateSystem(), is( CRSManager.lookup( "EPSG:4326" ) ) );
    Envelope boundingBox = getMap.getBoundingBox();
    assertThat( boundingBox.getMin().get0(), is( -115.4 ) );
    assertThat( boundingBox.getMin().get1(), is( 35.0 ) );
    assertThat( boundingBox.getMax().get0(), is( -108.0 ) );
    assertThat( boundingBox.getMax().get1(), is( 44.0 ) );
    Map<String, String> parameterMap = getMap.getParameterMap();
    assertThat( parameterMap.size(), is( 1 ) );
    assertThat( parameterMap.get( "EXCEPTIONS" ), is( "INIMAGE" ) );
    HashMap<String, List<?>> dimensions = getMap.getDimensions();
    assertThat( dimensions.size(), is( 2 ) );
    assertThat( ( (List<DateTime>) dimensions.get( "time" ) ).size(), is( 1 ) );
    assertThat( ( (List<DateTime>) dimensions.get( "time" ) ).get( 0 ).getDate(), is( expectedDateTime() ) );
    assertThat( ( (List<Double>) dimensions.get( "elevation" ) ).size(), is( 1 ) );
    assertThat( ( (List<Double>) dimensions.get( "elevation" ) ).get( 0 ), is( 5d ) );
}