UrlUtil { public static boolean isExternal(String url) { if (url.startsWith(" return true; } return url.contains(": } private  UrlUtil(); static boolean isExternal(String url);  }
@Test public void isExternal_URLStartsWithTwoSlashes_returnsTrue() { Assert.assertTrue(UrlUtil.isExternal(" }
@Test public void isExternal_URLContainsAnySchemaAsPrefix_returnsTrue() { Assert.assertTrue(UrlUtil.isExternal("http: Assert.assertTrue(UrlUtil.isExternal("https: Assert.assertTrue(UrlUtil.isExternal("context: Assert.assertTrue(UrlUtil.isExternal("base: }
@Test public void isExternal_URLDoesnotContainSchema_returnsFalse() { Assert.assertFalse(UrlUtil.isExternal("foo")); }