code: public HFCAAffiliationResp create(User registrar, boolean force) throws AffiliationException, InvalidArgumentException {
          if (registrar == null) {
              throw new InvalidArgumentException("Registrar should be a valid member");
          }
  
          String createURL = "";
          try {
              createURL = client.getURL(HFCA_AFFILIATION);
              logger.debug(format("affiliation  url: %s, registrar: %s", createURL, registrar.getName()));
  
              Map<String, String> queryParm = new HashMap<String, String>();
              queryParm.put("force", String.valueOf(force));
              String body = client.toJson(affToJsonObject());
              JsonObject result = client.httpPost(createURL, body, registrar);
  
              logger.debug(format("identity  url: %s, registrar: %s done.", createURL, registrar));
              this.deleted = false;
              return getResponse(result);
          } catch (HTTPException e) {
              String msg = format("[Code: %d] - Error while creating affiliation '%s' from url '%s': %s", e.getStatusCode(), this.name, createURL, e.getMessage());
              AffiliationException affiliationException = new AffiliationException(msg, e);
              logger.error(msg);
              throw affiliationException;
          } catch (Exception e) {
              String msg = format("Error while creating affiliation %s url: %s  %s ", this.name, createURL, e.getMessage());
              AffiliationException affiliationException = new AffiliationException(msg, e);
              logger.error(msg);
              throw affiliationException;
          }
      }
docs: create an affiliation
  
  @param registrar The identity of the registrar (i.e. who is performing the registration).
  @param force Forces the creation of parent affiliations
  @return Response of request
  @throws AffiliationException    if adding an affiliation fails.
  @throws InvalidArgumentException