public static String getPathTemplate(final ExtendedUriInfo uriInfo) {
      final StringBuilder pathBuilder = new StringBuilder();

      for (int i = uriInfo.getMatchedTemplates().size() - 1; i >= 0; i--) {
          pathBuilder.append(uriInfo.getMatchedTemplates().get(i).getTemplate());
      }

      return pathBuilder.toString();
  }
@Test
  void testGetPathTemplate() {
    final UriTemplate firstComponent = new UriTemplate("/first");
    final UriTemplate secondComponent = new UriTemplate("/second");
    final UriTemplate thirdComponent = new UriTemplate("/{param}/{moreDifferentParam}");

    final ExtendedUriInfo uriInfo = mock(ExtendedUriInfo.class);
    when(uriInfo.getMatchedTemplates()).thenReturn(Arrays.asList(thirdComponent, secondComponent, firstComponent));

    assertEquals("/first/second/{param}/{moreDifferentParam}", UriInfoUtil.getPathTemplate(uriInfo));
  }