### Question:
IDFedLSInputResolver implements LSResourceResolver { public IDFedLSInput resolveResource(String type, String namespaceURI, final String publicId, final String systemId, final String baseURI) { if (systemId == null) { throw new IllegalArgumentException("Expected systemId"); } final String loc = schemaLocationMap.get(systemId); if (loc == null) { return null; } return new IDFedLSInput(baseURI, loc, publicId, systemId); }  static Collection<String> schemas(); IDFedLSInput resolveResource(String type, String namespaceURI, final String publicId, final String systemId, final String baseURI);  }### Answer:
@Test public void testSchemaConstruction() throws Exception { SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); final IDFedLSInputResolver idFedLSInputResolver = new IDFedLSInputResolver(); schemaFactory.setResourceResolver(new LSResourceResolver() { @Override public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) { LSInput input = idFedLSInputResolver.resolveResource(type, namespaceURI, publicId, systemId, baseURI); if(input == null) { throw new IllegalArgumentException("Unable to resolve " + systemId); } InputStream is = input.getByteStream(); if(is == null) { throw new IllegalArgumentException("Unable to resolve stream for " + systemId); } try { is.close(); } catch (IOException e) { throw new RuntimeException(e); } return input; } }); for(String schema : SchemaManagerUtil.getSchemas()) { if(schema.contains("saml")) { URL schemaFile = SecurityActions.loadResource(getClass(), schema); schemaFactory.newSchema(schemaFile); } } JAXPValidationUtil.validator(); }