@VisibleForTesting
  static boolean isUriValid(String uri) {
    Matcher matcher = URI_PATTERN.matcher(uri);
    return matcher.matches();
  }
@Test
  public void testValidUri() {
    assertThat(
            HttpCacheServerHandler.isUriValid(
                "http://some-path.co.uk:8080/ac/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
        .isTrue();
    assertThat(
            HttpCacheServerHandler.isUriValid(
                "http://127.12.12.0:8080/ac/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
        .isTrue();
    assertThat(
            HttpCacheServerHandler.isUriValid(
                "http://localhost:8080/ac/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
        .isTrue();
    assertThat(
            HttpCacheServerHandler.isUriValid(
                "https://localhost:8080/ac/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
        .isTrue();
    assertThat(
            HttpCacheServerHandler.isUriValid(
                "localhost:8080/ac/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
        .isTrue();
    assertThat(
            HttpCacheServerHandler.isUriValid(
                "ac/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
        .isTrue();

    assertThat(
            HttpCacheServerHandler.isUriValid(
                "http://some-path.co.uk:8080/cas/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
        .isTrue();
    assertThat(
            HttpCacheServerHandler.isUriValid(
                "http://127.12.12.0:8080/cas/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
        .isTrue();
    assertThat(
            HttpCacheServerHandler.isUriValid(
                "http://localhost:8080/cas/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
        .isTrue();
    assertThat(
            HttpCacheServerHandler.isUriValid(
                "https://localhost:8080/cas/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
        .isTrue();
    assertThat(
            HttpCacheServerHandler.isUriValid(
                "localhost:8080/cas/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
        .isTrue();
    assertThat(
            HttpCacheServerHandler.isUriValid(
                "cas/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
        .isTrue();
  }