public static Optional<String> urlEncode(String raw) {
    try {
      return Optional.of(URLEncoder.encode(raw, UTF_8.toString()));
    } catch (UnsupportedEncodingException e) {
      return Optional.empty();
    }
  }
@Test
  public void urlEncode_whenUnicode_encodesOriginal() {
    // EURO sign
    assertThat(urlEncode("\u20AC")).hasValue("%E2%82%AC");
  }