@Test public void rfc3986_fragmentEncodingOptional() { assertMaybeEncoded('!', PercentEncoder.encodeFragment("!")); assertMaybeEncoded('$', PercentEncoder.encodeFragment("$")); assertMaybeEncoded('&', PercentEncoder.encodeFragment("&")); assertMaybeEncoded('\'', PercentEncoder.encodeFragment("'")); assertMaybeEncoded('(', PercentEncoder.encodeFragment("(")); assertMaybeEncoded(')', PercentEncoder.encodeFragment(")")); assertMaybeEncoded('*', PercentEncoder.encodeFragment("*")); assertMaybeEncoded('+', PercentEncoder.encodeFragment("+")); assertMaybeEncoded(',', PercentEncoder.encodeFragment(",")); assertMaybeEncoded('/', PercentEncoder.encodeFragment("/")); assertMaybeEncoded('0', PercentEncoder.encodeFragment("0")); assertMaybeEncoded('1', PercentEncoder.encodeFragment("1")); assertMaybeEncoded('2', PercentEncoder.encodeFragment("2")); assertMaybeEncoded('3', PercentEncoder.encodeFragment("3")); assertMaybeEncoded('4', PercentEncoder.encodeFragment("4")); assertMaybeEncoded('5', PercentEncoder.encodeFragment("5")); assertMaybeEncoded('6', PercentEncoder.encodeFragment("6")); assertMaybeEncoded('7', PercentEncoder.encodeFragment("7")); assertMaybeEncoded('8', PercentEncoder.encodeFragment("8")); assertMaybeEncoded('9', PercentEncoder.encodeFragment("9")); assertMaybeEncoded(':', PercentEncoder.encodeFragment(":")); assertMaybeEncoded(';', PercentEncoder.encodeFragment(";")); assertMaybeEncoded('=', PercentEncoder.encodeFragment("=")); assertMaybeEncoded('?', PercentEncoder.encodeFragment("?")); assertMaybeEncoded('@', PercentEncoder.encodeFragment("@")); }
public static String encodeFragment(String fragment) { return PercentEncoder.encode(fragment, safeFragment, false, false); }
PercentEncoder { public static String encodeFragment(String fragment) { return PercentEncoder.encode(fragment, safeFragment, false, false); } }
PercentEncoder { public static String encodeFragment(String fragment) { return PercentEncoder.encode(fragment, safeFragment, false, false); }  }
PercentEncoder { public static String encodeFragment(String fragment) { return PercentEncoder.encode(fragment, safeFragment, false, false); }  static String encodePathSegment(String segment); static String encodeQueryComponent(String component); static String encodeQueryComponentNoPlusForSpace(String component); static String encodeFragment(String fragment); static String reEncodePath(String path); static String reEncodeQuery(String query); static String reEncodeFragment(String fragment); }
PercentEncoder { public static String encodeFragment(String fragment) { return PercentEncoder.encode(fragment, safeFragment, false, false); }  static String encodePathSegment(String segment); static String encodeQueryComponent(String component); static String encodeQueryComponentNoPlusForSpace(String component); static String encodeFragment(String fragment); static String reEncodePath(String path); static String reEncodeQuery(String query); static String reEncodeFragment(String fragment);  }