### Question:
CommonUtils { public static String removeDefaultHttpPorts(final String uri) { URL url; try { url = new URL(uri); if (url.getPort() == url.getDefaultPort()) { String urlPort = ":" + url.getPort(); return url.toExternalForm().replace(urlPort, ""); } } catch (MalformedURLException e) { return null; } return url.toExternalForm(); } private  CommonUtils(); static Boolean isAscendingOrder(String sorting); static String removeDefaultHttpPorts(final String uri);  }### Answer:
@Test public void httpsPorts() { assertThat(removeDefaultHttpPorts("https: assertThat(removeDefaultHttpPorts("https: assertThat(removeDefaultHttpPorts("https: assertThat(removeDefaultHttpPorts("localhost/auth")).isNull(); }
@Test public void httpPorts() { assertThat(removeDefaultHttpPorts("http: assertThat(removeDefaultHttpPorts("http: assertThat(removeDefaultHttpPorts("http: assertThat(removeDefaultHttpPorts("localhost/auth")).isNull(); }