code: public void changePassword(String newPassword) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
          if (!connection().isSecureConnection() && !allowSensitiveOperationOverInsecureConnection) {
              throw new IllegalStateException("Changing password over insecure connection.");
          }
          Map<String, String> map = new HashMap<>();
          map.put("username",  connection().getUser().getLocalpart().toString());
          map.put("password",newPassword);
          Registration reg = new Registration(map);
          reg.setType(IQ.Type.set);
          reg.setTo(connection().getXMPPServiceDomain());
          createStanzaCollectorAndSend(reg).nextResultOrThrow();
      }
docs: Changes the password of the currently logged-in account. This operation can only
  be performed after a successful login operation has been completed. Not all servers
  support changing passwords; an XMPPException will be thrown when that is the case.
  
  @param newPassword new password.
  
  @throws IllegalStateException if not currently logged-in to the server.
  @throws XMPPErrorException if an error occurs when changing the password.
  @throws NoResponseException if there was no response from the server.
  @throws NotConnectedException
  @throws InterruptedException