### Question:
UrlValidator { public static boolean isUrlValid(String url) { try { new URL(url).toURI(); return true; } catch (MalformedURLException e) { throw new InvalidURLException(ErrorMessage.MALFORMED_URL); } catch (URISyntaxException e) { throw new InvalidURLException(ErrorMessage.INVALID_URI); } }  static boolean isUrlValid(String url);  }### Answer:
@Test void UrlValidatorTrueTest() throws MalformedURLException { String url = getUrl().toString(); assertTrue(UrlValidator.isUrlValid(url)); }
@Test void UrlValidatorMalformedURLExceptionTest() { String url = "ttt: Assertions.assertThrows(InvalidURLException.class, () -> UrlValidator.isUrlValid(url)); }
@Test void UrlValidatorURISyntaxExceptionTest() { String url = "http: Assertions.assertThrows(InvalidURLException.class, () -> UrlValidator.isUrlValid(url)); }