### Question:
StringUtils { public static double getDifference(String first, String second) { if (first == null || second == null) { return 1.0; } StringSimilarityService service = new StringSimilarityServiceImpl(new LevenshteinDistanceStrategy()); return Math.abs(service.score(first, second) - 1.0); } private  StringUtils(); static double getDifference(String first, String second); static boolean containsAny(String str, Iterable<String> pieces); static boolean isEmpty(String str); static String formatException(Throwable th); static boolean isInsideString(char needle, String haystack);  }### Answer:
@Test public void shouldGetDifferenceWithNullString() { assertThat(StringUtils.getDifference(null, "test"), equalTo(1.0)); assertThat(StringUtils.getDifference("test", null), equalTo(1.0)); assertThat(StringUtils.getDifference(null, null), equalTo(1.0)); }
@Test public void shouldGetDifferenceBetweenTwoString() { assertThat(StringUtils.getDifference("test", "taste"), equalTo(0.4)); assertThat(StringUtils.getDifference("test", "bear"), equalTo(0.75)); assertThat(StringUtils.getDifference("test", "something"), greaterThan(0.88)); }