### Question:
Utility { public static boolean validateUrl(String url) { if (TextUtils.isEmpty(url)) { return false; } pattern = Pattern.compile(URL_PATTERN); matcher = pattern.matcher(url); if (matcher.matches()) { return true; } return false; }  static String formatDate(Date messageDate); static boolean isEmpty(Collection<?> collection); static String formatTimestamp(Context context, long timestamp); static String removeWhitespaces(String s); static boolean validateUrl(String url); static boolean isConnected(Context context); static void showNotification(Context context); static BuildNotification getSyncNotificationStatus(Context context,
            String message); static void showSyncNotificationStatus(Context context, String message,
            BuildNotification buildNotification); static void buildNotification(Context context, int drawable,
            String message, String title, PendingIntent intent, boolean ongoing); static void clearAll(Context context); static void clearNotify(Context context); static void connectToDataNetwork(@NonNull Context context); static String getPhoneNumber(@NonNull Context context, @NonNull PrefsFactory prefs); static String capitalizeFirstLetter(String text); static char getFirstCharacter(String name); static void makeDefaultSmsApp(Activity activity); static boolean isDefaultSmsApp(Context context); static int calculateBatteryLevel(int level, int scale); static int dipToPixels(Context context, float dipValue); static int keywordColor(); @DrawableRes static int keywordIcon(); static final int NOTIFICATION_PROGRESS_BAR_MAX; static final int SET_DEFAULT_SMS_REQUEST; }### Answer:
@Test public void shouldCheckUrlIsValid() { boolean actual = Utility.validateUrl("http: assertTrue("The provided URL is not a valid one", actual); }
@Test public void shouldCheckForIPBasedUrlToBeValid() { boolean actual = Utility.validateUrl("http: assertTrue("The provided URL is not a valid one", actual); }