Strings { public static String trimToNull(String s) { s = trim(s); return isNotEmpty(s) ? s : null; }  static String join(Iterable<?> col, String separator); static boolean isBlank(String s); static boolean isNotBlank(String s); static boolean isEmpty(String s); static boolean isNotEmpty(String s); static List<String> splitAndTrim(String value, String regex); static String trim(String s); static String trimToNull(String s); static String joinClassNames(Iterable<?> iterable); static Boolean toBoolean(String s);  }
@Test void testTrimToNull() { assertNull(Strings.trimToNull(null)); assertNull(Strings.trimToNull("")); assertNull(Strings.trimToNull(" ")); assertEquals("foo", Strings.trimToNull(" foo ")); }