### Question:
Equals { public static boolean safeTrimmedStringEquals(final String s1, final String s2) { final String s1Trimmed = s1 == null ? "" : s1.trim(); final String s2Trimmed = s2 == null ? "" : s2.trim(); return s1Trimmed.equals(s2Trimmed); }  static boolean safeEquals(final Object obj1, final Object obj2); static boolean isNullOrBlank(final String s); static boolean safeTrimmedStringEquals(final String s1, final String s2);  }### Answer:
@Test public void shouldBeSameString_withWhitespaceAdded() { final String s = Randoms.randomString(10); final String s1 = " " + s; final String s2 = s + "\t\t"; assertTrue(Equals.safeTrimmedStringEquals(s1, s2)); }
@Test public void shouldBeSameString_withNullOrBlankStrings() { assertTrue(Equals.safeTrimmedStringEquals(null, null)); assertTrue(Equals.safeTrimmedStringEquals(" ", null)); assertTrue(Equals.safeTrimmedStringEquals(null, "\t")); assertTrue(Equals.safeTrimmedStringEquals(" ", "\n\n")); }
@Test public void shouldNotBeSameString_withDifferentStrings() { final String s1 = Randoms.randomString(5); final String s2 = Randoms.randomString(8); assertFalse(Equals.safeTrimmedStringEquals(s1, s2)); }