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_whenEmptyString_returnsOriginal() {
    assertThat(urlEncode("")).hasValue("");
  }