### Question:
UriInfoImpl implements UriInfo { public List<PathSegment> getPathSegments() { return getPathSegments(true); } @SuppressWarnings("unchecked")  UriInfoImpl(Message m);  UriInfoImpl(Message m, MultivaluedMap<String, String> templateParams); URI getAbsolutePath(); UriBuilder getAbsolutePathBuilder(); URI getBaseUri(); UriBuilder getBaseUriBuilder(); String getPath(); String getPath(boolean decode); List<PathSegment> getPathSegments(); List<PathSegment> getPathSegments(boolean decode); MultivaluedMap<String, String> getQueryParameters(); MultivaluedMap<String, String> getQueryParameters(boolean decode); URI getRequestUri(); UriBuilder getRequestUriBuilder(); MultivaluedMap<String, String> getPathParameters(); MultivaluedMap<String, String> getPathParameters(boolean decode); List<Object> getMatchedResources(); List<String> getMatchedURIs(); List<String> getMatchedURIs(boolean decode); @Override URI relativize(URI uri); @Override URI resolve(URI uri);  }### Answer:
@Test public void testGetPathSegments() { UriInfoImpl u = new UriInfoImpl(mockMessage("http: null); List<PathSegment> segments = u.getPathSegments(); assertEquals(3, segments.size()); assertEquals("bar", segments.get(0).toString()); assertEquals("foo", segments.get(1).toString()); assertEquals("x/b", segments.get(2).toString()); }
@Test public void testGetEncodedPathSegments() { UriInfoImpl u = new UriInfoImpl(mockMessage("http: null); List<PathSegment> segments = u.getPathSegments(false); assertEquals(3, segments.size()); assertEquals("bar", segments.get(0).toString()); assertEquals("foo", segments.get(1).toString()); assertEquals("x%2Fb", segments.get(2).toString()); }