code: public SecureUTF8String generatePassword(CharSequence masterPassword, String inputText, String username) {
          SecureUTF8String securedMasterPassword;
          if ( ! (masterPassword instanceof SecureUTF8String) ) {
              securedMasterPassword = new SecureUTF8String(masterPassword.toString());
          } else {
              securedMasterPassword = (SecureUTF8String)masterPassword;
          }
          SecureUTF8String result = null;
          try {
              Account accountToUse = getAccountForInputText(inputText);
              // use the one that takes a username if the username isn't null
              if ( username != null )
                  result = pwm.makePassword(securedMasterPassword, accountToUse, inputText, username);
              else
                  result = pwm.makePassword(securedMasterPassword, accountToUse, inputText);
          } catch (Exception e) {
              e.printStackTrace();
          }
          if ( result != null ) {
              return result;
          }
          return new SecureUTF8String();
      }
docs: Generate the password based on the masterPassword from the matching account from the inputtext
  
  @param masterPassword - the masterpassword to use
  @param inputText - the input text // url to use to find the account and generate the password
  @param username - (optional) the username to override the account's username unless its nil
  
  @return the generated password based on the matching account