UriComponent { public static String recognizeEncode(String str, int component, boolean containsUriParams) { if (str == null) { throw new IllegalArgumentException(); } return _encode(str, component, containsUriParams, true); } 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; }
@Test public void encodesStringRespectEncoded() { String str = "to be%23or not to%20be"; assertEquals("to%20be%23or%20not%20to%20be", recognizeEncode(str, PATH_SEGMENT, false)); }