code: public TenantDefinition modifyTenant(String tenantName, TenantDefinition newTenantDef) {
          checkServiceState();
          TenantDefinition oldTenantDef = getTenantDef(tenantName);
          Utils.require(oldTenantDef != null, "Tenant '%s' does not exist", tenantName);
          modifyTenantProperties(oldTenantDef, newTenantDef);
          validateTenantUsers(newTenantDef);
          validateTenantUpdate(oldTenantDef, newTenantDef);
          storeTenantDefinition(newTenantDef);
          DBManagerService.instance().updateTenantDef(newTenantDef);
          TenantDefinition updatedTenantDef = getTenantDef(tenantName);
          if (updatedTenantDef == null) {
              throw new RuntimeException("Tenant definition could not be retrieved after creation: " + tenantName);
          }
          removeUserHashes(updatedTenantDef);
          return updatedTenantDef; 
      }
docs: Modify the tenant with the given name to match the given definition, and return the
  updated definition.
  
  @param tenantName    Name of tenant to be modified.
  @param newTenantDef  Updated {@link TenantDefinition} to apply to tenant.
  @return              Updated {@link TenantDefinition}.