StringUtil { public static String removeHtmlAndSpecialChars( String str, boolean removeSpaces ) { String noHTML = removeHtml( str ); return removeSpecialChars( noHTML, removeSpaces ); } 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 testRemoveHtmlAndSpecialChars() { String result = StringUtil.removeHtmlAndSpecialChars( htmlString, true ); assertFalse( result.contains( "<" ) ); assertFalse( result.contains( "script" ) ); }