CapabilitiesParser { public static Capabilities parse(URL url) throws IOException, ParserConfigurationException, SAXException { try (InputStream in = url.openStream()) { return parse(in); } }  static Capabilities parse(URL url); static Capabilities parse(InputStream in); static Capabilities parse(Document doc);  }
@Test public void checkCapabilities() throws IOException, ParserConfigurationException, SAXException { Document doc; try (InputStream in = getClass().getClassLoader().getResourceAsStream("capabilities.xml")) { doc = XML.readDocument(in); } Capabilities capabilities = CapabilitiesParser.parse(doc); assertEquals("10163", capabilities.getUpdateSequence()); checkServiceIdentification(capabilities.getServiceIdentification()); checkOperationsMetadata(capabilities.getOperationsMetadata()); checkServiceMetadata(capabilities.getServiceMetadata()); checkContents(capabilities.getContents()); }