@Override
   public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
      log.debug("Resolving resource with systemId: {}", systemId);

      InputStream resourceStream = null;
      if (LOCAL_RESOLUTIONS.containsKey(systemId)) {
         log.debug("Got a local resolution, loading it from classloader");
         resourceStream = this.getClass().getClassLoader().getResourceAsStream(LOCAL_RESOLUTIONS.get(systemId));
      } else if (baseResourceURL != null && (!systemId.startsWith("http://") || !systemId.startsWith("https://"))) {
         log.debug("Got a baseResourceURL defined and relative reference, loading it from URL");
         String sanitizedSystemId = systemId;
         if (systemId.startsWith("./")) {
            sanitizedSystemId = systemId.substring(2);
         }
         try {
            URL resourceURL = new URL(baseResourceURL + (baseResourceURL.endsWith("/") ? "" : "/") + sanitizedSystemId);
            resourceStream = resourceURL.openStream();
         } catch (Exception e) {
            log.error("Failed to open stream on {}/{}", baseResourceURL, sanitizedSystemId, e);
         }
      }

      if (resourceStream != null) {
         Input input = new Input();
         input.setSystemId(systemId);
         input.setPublicId(publicId);
         input.setBaseURI(baseURI);
         input.setCharacterStream(new InputStreamReader(resourceStream));
         return input;
      }
      // Let default behaviour happen!
      return null;
   }
@Test
   void testResolveResourceWithLocalResolution() {
      String systemId = "http://www.w3.org/2001/xml.xsd";

      LSInput lsInput = resolver.resolveResource(null, null, null, systemId, null);

      assertNotNull(lsInput);
      assertEquals(systemId, lsInput.getSystemId());
      assertNotNull(lsInput.getCharacterStream());
   }