UriComponent { public static URI resolve(URI baseUri, URI resolvingUri) { checkArgument(baseUri != null, "Null base uri isn't allowed"); checkArgument(resolvingUri != null, "Null resolving uri isn't allowed"); String resolvingUriStr = resolvingUri.toString(); if (resolvingUriStr.isEmpty()) { return baseUri; } if (resolvingUriStr.startsWith("?")) { String baseUriStr = baseUri.toString(); int q = baseUriStr.indexOf('?'); if (q > 0) { return normalize(URI.create(baseUriStr.substring(0, q) + resolvingUriStr)); } return normalize(URI.create(baseUriStr + resolvingUriStr)); } return normalize(baseUri.resolve(resolvingUri)); } private  UriComponent(); static URI normalize(URI uri); static String encode(String str, int component, boolean containsUriParams); static String validateUriComponent(String str, int component, boolean containsUriParams); static boolean isUriComponentContainsValidCharacters(int component, String str); static String recognizeEncode(String str, int component, boolean containsUriParams); static String decode(String str, int component); static boolean checkHexCharacters(String s, int p); static List<PathSegment> parsePathSegments(String path, boolean decode); static MultivaluedMap<String, String> parseQueryString(String rawQuery, boolean decode); static URI resolve(URI baseUri, URI resolvingUri); static final int SCHEME; static final int USER_INFO; static final int HOST; static final int PORT; static final int PATH_SEGMENT; static final int PATH; static final int QUERY; static final int FRAGMENT; static final int SSP; static final int MATRIX_PARAM; static final int QUERY_STRING; static final String PERCENT; }
@UseDataProvider("forResolvesUri") @Test public void resolvesUri(URI baseUri, URI resolvingUri, URI expectedResult) { assertEquals(expectedResult, UriComponent.resolve(baseUri, resolvingUri)); }