public void setUsername(String username) {
        for (Authentication auth : authentications.values()) {
            if (auth instanceof HttpBasicAuth) {
                ((HttpBasicAuth) auth).setUsername(username);
                return;
            }
        }
        throw new RuntimeException("No HTTP basic authentication configured!");
    }
public void setUsername ( String username ) { for ( Authentication auth : authentications . values ( ) ) { if ( auth instanceof HttpBasicAuth ) { ( ( HttpBasicAuth ) auth ) . setUsername ( username ) ; return ; } } throw new RuntimeException ( "No HTTP basic authentication configured!" ) ; }
Helper method to set username for the first HTTP basic authentication.

@param username Username