### Question:
Utils { public static boolean safeRegexMatch(String pattern, String value) { if (StringUtils.isNotBlank(pattern)) { if (value == null) { return false; } else { try { return Pattern.matches(pattern, value); } catch (PatternSyntaxException ex) { return false; } } } else { return false; } } private  Utils(); static boolean safeRegexMatch(String pattern, String value); static List<String> asList(String text); static String run(File wd, String cmd, String... args); static String toHexString(byte[] bytes); static String toHexString(byte[] bytes, int start, int len); static String toString(byte[] bytes);  }### Answer:
@Test public void safeRegexMatch_null() { assertFalse(Utils.safeRegexMatch(null, null)); assertFalse(Utils.safeRegexMatch(null, "")); assertFalse(Utils.safeRegexMatch(null, "abc")); }
@Test public void safeRegexMatch_empty() { assertFalse(Utils.safeRegexMatch("", null)); assertFalse(Utils.safeRegexMatch("", "")); assertFalse(Utils.safeRegexMatch("", "abc")); }
@Test public void safeRegexMatch_blank() { assertFalse(Utils.safeRegexMatch(" ", null)); assertFalse(Utils.safeRegexMatch(" ", "")); assertFalse(Utils.safeRegexMatch(" ", "abc")); }
@Test public void safeRegexMatch_correct() { assertFalse(Utils.safeRegexMatch("ab.*", null)); assertFalse(Utils.safeRegexMatch("ab.*", "")); assertTrue(Utils.safeRegexMatch("ab.*", "abc")); assertFalse(Utils.safeRegexMatch("ab.*", "acb")); }
@Test public void safeRegexMatch_incorrect() { assertFalse(Utils.safeRegexMatch("ab.*)", null)); assertFalse(Utils.safeRegexMatch("ab.*)", "")); assertFalse(Utils.safeRegexMatch("ab.*)", "abc")); assertFalse(Utils.safeRegexMatch("ab.*)", "acb")); }