### Question:
CalculateService { public static boolean equal(Pattern patternValue, String referenceValue, String currentValue) { if (currentValue == null) { return false; } if (patternValue == null) { return currentValue.equals(referenceValue); } return patternValue.matcher(currentValue).matches(); } private  CalculateService(); static boolean contains(Pattern patternValue, String referenceValue, String currentValue); static boolean equal(Pattern patternValue, String referenceValue, String currentValue); static boolean startsWith(Pattern patternValue, String referenceValue, String currentValue); static boolean endsWith(Pattern patternValue, String referenceValue, String currentValue);  }### Answer:
@Test public void checkSimpleEqualOk() { assertThat(CalculateService.equal(null, "toto", "toto")).isTrue(); }
@Test public void checkSimpleEqualNok() { assertThat(CalculateService.equal(null, "toto", "tot")).isFalse(); }
@Test public void checkPatternEqualOk() { assertThat(CalculateService.equal(Pattern.compile("[to]*"), null, "toto")).isTrue(); }
@Test public void checkPatternEqualNok() { assertThat(CalculateService.equal(Pattern.compile("[to]?"), null, "tot")).isFalse(); }