### Question:
UrlUtils { public static String maskCredentialsInUrl(String lineWithCredentials) { Matcher matcher = CredentialsInUrlRegexpPattern.matcher(lineWithCredentials); if (!matcher.find()) { return lineWithCredentials; } String credentialsPart = matcher.group(); String[] split = credentialsPart.split(" return StringUtils.replace(lineWithCredentials, credentialsPart, split[0] + " }  static String maskCredentialsInUrl(String lineWithCredentials);  }### Answer:
@Test(dataProvider = "testMaskUrlsProvider") public void testMaskCredentialsInUrl(String testName, String originalUrl, String expectedUrl) { Assert.assertEquals(UrlUtils.maskCredentialsInUrl(originalUrl), expectedUrl, "Failed masking credentials on test name: " + testName); }