StringUtil { public static boolean containsHtml( String str ) { if ( StringUtils.isBlank( str ) ) { return false; } else { return Jsoup.isValid( str, Whitelist.none() ) ? false : true; } } private  StringUtil(); static String escapeHtml( String str ); static boolean isBase64( String str ); static boolean isValidSshPublicKey( String sshKey ); static String unEscapeHtml( String str ); static boolean containsHtml( String str ); static String removeHtml( String str ); static String removeHtmlAndSpecialChars( String str, boolean removeSpaces ); static String removeSpecialChars( String str, boolean removeSpaces ); static boolean isValidEmail( String email );  }
@Test public void testIsContainsHtml() { assertTrue( StringUtil.containsHtml( htmlString ) ); assertFalse( StringUtil.containsHtml( nonHtmlString ) ); }