@Override
   public String buildRemoteURL(String baseRepositoryURL, String referencePath) {
      // Rebuild a downloadable URL to retrieve file.
      String remoteUrl = baseRepositoryURL.substring(0, baseRepositoryURL.lastIndexOf("/"));
      String pathToAppend = referencePath;
      while (pathToAppend.startsWith("../")) {
         remoteUrl = remoteUrl.substring(0, remoteUrl.lastIndexOf("/"));
         pathToAppend = pathToAppend.substring(3);
      }
      if (pathToAppend.startsWith("./")) {
         pathToAppend = pathToAppend.substring(2);
      }
      if (pathToAppend.startsWith("/")) {
         pathToAppend = pathToAppend.substring(1);
      }
      remoteUrl += "/" + pathToAppend;
      return remoteUrl;
   }
@Test
   void testBuildRemoteURL() {

      SimpleReferenceURLBuilder builder = new SimpleReferenceURLBuilder();
      assertEquals("https://raw.githubusercontent.com/microcks/microcks/main/samples/schema-ref.yml",
            builder.buildRemoteURL(BASE_URL, "schema-ref.yml"));
      assertEquals("https://raw.githubusercontent.com/microcks/microcks/main/samples/schema-ref.yml",
            builder.buildRemoteURL(BASE_URL, "./schema-ref.yml"));
      assertEquals("https://raw.githubusercontent.com/microcks/microcks/main/refs/schema-ref.yml",
            builder.buildRemoteURL(BASE_URL, "../refs/schema-ref.yml"));
      assertEquals("https://raw.githubusercontent.com/microcks/microcks/main/refs/sub/schema-ref.yml",
            builder.buildRemoteURL(BASE_URL, "../refs/sub/schema-ref.yml"));
      assertEquals("https://raw.githubusercontent.com/microcks/microcks/refs/sub/schema-ref.yml",
            builder.buildRemoteURL(BASE_URL, "../../refs/sub/schema-ref.yml"));
   }