CommonStringMethods { public static String safeTrim(String string) { if (string == null) { return null; } return string.trim(); } private  CommonStringMethods(); static boolean isNullEmptyOrBlank(String string); static String safeTrim(String string); static boolean nullSafeEquals(String a, String b);  }
@Test public void testStringSafeTrim() { assertNull(CommonStringMethods.safeTrim(null)); assertEquals("", CommonStringMethods.safeTrim("")); assertEquals("abc", CommonStringMethods.safeTrim("abc")); assertEquals("abc", CommonStringMethods.safeTrim(" abc \r\t\n ")); }