StringsHelper { public static boolean match(final String reference, final String value, final boolean strict) { return strict ? StringUtils.equalsIgnoreCase(reference, value) : StringUtils.containsIgnoreCase(reference, value); }  static boolean match(final String reference, final String value, final boolean strict); static String normalizeString(String s);  }
@Test public void match_should_succeed_in_strict_mode() throws Exception { final boolean strict = true; final String reference = "Jimmy"; final String value = "jimmy"; final boolean result = StringsHelper.match(reference, value, strict); assertTrue(result); }
@Test public void match_should_fail_in_strict_mode() throws Exception { final boolean strict = true; final String reference = "Jimmy"; final String value = "imm"; final boolean result = StringsHelper.match(reference, value, strict); assertFalse(result); }
@Test public void match_should_succeed_in_non_strict_mode() throws Exception { final boolean strict = false; final String reference = "Jimmy"; final String value = "Imm"; final boolean result = StringsHelper.match(reference, value, strict); assertTrue(result); }
@Test public void match_should_fail_in_non_strict_mode() throws Exception { final boolean strict = false; final String reference = "Jimmy"; final String value = "Jammy"; final boolean result = StringsHelper.match(reference, value, strict); assertFalse(result); }