private static boolean isWhitespace ( StringBuilder builder ) { for ( int i = 0 ; i < builder . length ( ) ; i ++ ) { if ( ! Character . isWhitespace ( builder . charAt ( i ) ) ) { return false ; } } return true ; }
If the builder is empty or contains only whitespaces