sb.append( ( String ) it.next() );  if ( it.hasNext() )
if ( isFirst ) { isFirst = false; } else
    private String buildErrorMessage( String username, String password, int passwordLength, int categoryCount,        int tokenSize )    {        List violations = new ArrayList();        if ( !isValidPasswordLength( password, passwordLength ) )        {            violations.add( "length too short" );        }        if ( !isValidCategoryCount( password, categoryCount ) )        {            violations.add( "insufficient character mix" );        }        if ( !isValidUsernameSubstring( username, password, tokenSize ) )        {            violations.add( "contains portions of username" );        }        StringBuffer sb = new StringBuffer( "Password violates policy:  " );        Iterator it = violations.iterator();        while ( it.hasNext() )        {            sb.append( ( String ) it.next() );            if ( it.hasNext() )            {                sb.append( ", " );            }        }        return sb.toString();    }