URLUtil { public static String getURL(String message) { if (URLUtil.isURL(message)) { final String url = message.substring(URLUtil.URL_START.length(), message.length() - URLUtil.URL_END.length()); return url; } else { return null; } }  static byte[] getData(String url, String encoding); static String getDataEncoding(String url); static boolean isURL(String message); static String getURL(String message); static final String URL_START; static final String URL_END; }
@Test public void testGetURL() throws Exception { assertEquals("http: assertNull(URLUtil.getURL("some message")); }