Strings { public static boolean empty( String value ) { return value == null || "".equals(value); }  static String diff( String original, String revised ); static int count( String source, String regex ); static boolean nonEmpty(String value); static boolean empty( String value ); static boolean emptyWithTrimming( String value ); static String truncate( String value, int maxLength ); static String repeat( String value , int iterations ); static List<String> split( String string, String regex ); static String[] toArray( List<String> input ); @Deprecated static List<String> toList( String[] strings ); static ImmutableList<String> toStrings(Object... objects); static List<String> toLines( String data ); static String padding( char c , int length ); static int lengthNullSafe( String value ); static Integer toInteger(T value ); static InputStream toInputStream(String text); static InputStream toInputStream(String text, Charset charset);  }
@Test public void testEmpty() throws Exception { Assert.assertEquals( true, Strings.empty( null ) ); assertEquals( true, Strings.empty( "" ) ); assertEquals( false, Strings.empty( "asdf" ) ); }