StringUtil { public static String trimToEmpty( String string ) { return StringUtils.trimToEmpty( string ); } private  StringUtil(); static String[] tokenStringToArray( final String tokenizedString, final String token ); static boolean doesPathContainParentPathSegment( final String path ); static void main( final String[] args ); static boolean isEmpty( final String str ); static String getMapAsPrettyString( final Map map ); static Map<String, String> trimStringMap( Map<String, String> map ); static List<String> trimStringList( List<String> list ); static String trimToEmpty( String string );  }
@Test public void testTrim() { Assert.assertEquals( StringUtil.trimToEmpty( " foo " ), "foo" ); Assert.assertEquals( StringUtil.trimToEmpty( "\n foo \t" ), "foo" ); for ( int i = 0; i <= 32; i++ ) { Assert.assertEquals( StringUtil.trimToEmpty( (char) i + "foo" ), "foo" ); } Assert.assertEquals( StringUtil.trimToEmpty( "" ), "" ); Assert.assertEquals( StringUtil.trimToEmpty( null ), "" ); }