WMTSCapabilitiesAdapter extends OWSCommon110CapabilitiesAdapter { public List<Layer> parseLayers() throws XMLStreamException { OMElement contentsElement = getElement( getRootElement(), new XPath( "wmts:Contents", nsContext ) ); XMLStreamReader xmlStream = contentsElement.getXMLStreamReader(); skipStartDocument( xmlStream ); nextElement( xmlStream ); List<Layer> layers = emptyList(); if ( skipToElementOnSameLevel( xmlStream, LAYER ) ) { layers = parseLayers( xmlStream ); } return layers; } WMTSCapabilitiesAdapter(); List<Layer> parseLayers(); List<TileMatrixSet> parseTileMatrixSets();  }
@Test public void testParseLayers() throws XMLStreamException { List<Layer> layers = adapter.parseLayers(); assertEquals( 1, layers.size() ); }