code: public void sendRegistrationForm(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
          Registration reg = new Registration();
          reg.setType(IQ.Type.set);
          reg.setTo(room);
          reg.addExtension(form.getDataFormToSend());
  
          connection.createStanzaCollectorAndSend(reg).nextResultOrThrow();
      }
docs: Sends the completed registration form to the server. After the user successfully submits
  the form, the room may queue the request for review by the room admins or may immediately
  add the user to the member list by changing the user's affiliation from "none" to "member.<p>
  
  If the desired room nickname is already reserved for that room, the room will return a
  "Conflict" error to the user (error code 409). If the room does not support registration,
  it will return a "Service Unavailable" error to the user (error code 503).
  
  @param form the completed registration form.
  @throws XMPPErrorException if an error occurs submitting the registration form. In particular, a
  409 error can occur if the desired room nickname is already reserved for that room;
  or a 503 error can occur if the room does not support registration.
  @throws NoResponseException if there was no response from the server.
  @throws NotConnectedException
  @throws InterruptedException