code: public void addIndividual(org.opencb.biodata.models.metadata.Individual individual, String studyId) {
          // Sanity check
          if (individual == null || StringUtils.isEmpty(individual.getId())) {
              logger.error("Individual (or its ID) is null or empty.");
              return;
          }
  
          VariantStudyMetadata variantStudyMetadata = getVariantStudyMetadata(studyId);
          if (variantStudyMetadata == null) {
              logger.error("Study not found. Check your study ID: '{}'", studyId);
              return;
          }
          if (variantStudyMetadata.getIndividuals() == null) {
              variantStudyMetadata.setIndividuals(new ArrayList<>());
          }
          for (org.opencb.biodata.models.metadata.Individual indi: variantStudyMetadata.getIndividuals()) {
              if (indi.getId() != null && indi.getId().equals(individual.getId())) {
                  logger.error("Individual with id '{}' already exists in study '{}'", individual.getId(),
                          studyId);
                  return;
              }
          }
          variantStudyMetadata.getIndividuals().add(individual);
      }
docs: Add an individual to a given variant study metadata (from study ID).
  
  @param individual  Individual to add
  @param studyId   Study ID