PathAndQuery { @Nullable public static PathAndQuery parse(@Nullable String rawPath) { if (CACHE != null && rawPath != null) { final PathAndQuery parsed = CACHE.getIfPresent(rawPath); if (parsed != null) { return parsed; } } return splitPathAndQuery(rawPath); } private  PathAndQuery(String path, @Nullable String query); static void registerMetrics(MeterRegistry registry, MeterIdPrefix idPrefix); @VisibleForTesting static void clearCachedPaths(); @VisibleForTesting static Set<String> cachedPaths(); @Nullable static PathAndQuery parse(@Nullable String rawPath); void storeInCache(@Nullable String rawPath); String path(); @Nullable String query(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String toString();  }
@Test public void relative() { assertThat(PathAndQuery.parse("foo")).isNull(); }
@Test public void hexadecimal() { assertThat(PathAndQuery.parse("/%")).isNull(); assertThat(PathAndQuery.parse("/%0")).isNull(); assertThat(PathAndQuery.parse("/%0X")).isNull(); assertThat(PathAndQuery.parse("/%X0")).isNull(); }
@Test public void colon() { assertThat(PathAndQuery.parse("/:")).isNull(); assertThat(PathAndQuery.parse("/:/")).isNull(); assertThat(PathAndQuery.parse("/a/:")).isNotNull(); assertThat(PathAndQuery.parse("/a/:/")).isNotNull(); }