UrlValueConverter extends AbstractValueConverter<URL> { @Override public String toSafeString(URL value) { if (value == null) { return null; } final String userInfo = value.getUserInfo(); final String urlAsString = value.toString(); if (userInfo != null) { return urlAsString.replace(userInfo, getSafeUserInfo(userInfo)); } else { return urlAsString; } } private  UrlValueConverter(); @Override URL convert(String s); @Override String toString(URL value); @Override String toSafeString(URL value); static final ValueConverter<URL> INSTANCE; }
@Test public void testToSafeString() throws Exception { SoftAssertions.assertSoftly(softly -> { softly.assertThat(converter.toSafeString(converter.convert("http: softly.assertThat(converter.toSafeString(converter.convert("https: }); }