UriConverter implements Converter<Uri, String> { @NonNull @Override public Uri toConverted(@Nullable String supported) { if (supported == null) { return Uri.EMPTY; } return Uri.parse(supported); }  @NonNull @Override Uri toConverted(@Nullable String supported); @NonNull @Override String toSupported(@Nullable Uri converted);  }
@Test public void toConvertedShouldReturnParsedUri() throws Exception { final Uri actual = underTest.toConverted("https: assertThat(actual) .hasScheme("https") .hasHost("github.com"); }
@Test public void toConvertedShouldReturnEmptyWhenNullIsGiven() throws Exception { final Uri actual = underTest.toConverted(null); assertThat(actual) .isEqualTo(Uri.EMPTY); }