code: public Service setSupportedServiceProfiles(Iterable<ServiceProfile> profiles)
      {
          if (profiles == null)
          {
              this.supportedServiceProfiles = null;
  
              return this;
          }
  
          Set<ServiceProfile> set = new TreeSet<ServiceProfile>();
  
          for (ServiceProfile profile : profiles)
          {
              if (profile != null)
              {
                  set.add(profile);
              }
          }
  
          int size = set.size();
  
          if (size == 0)
          {
              this.supportedServiceProfiles = null;
  
              return this;
          }
  
          ServiceProfile[] array = new ServiceProfile[size];
          this.supportedServiceProfiles = set.toArray(array);
  
          return this;
      }
docs: Set the supported service profiles.
  
  @param profiles
  Supported service profiles.
  
  @return
  {@code this} object.
  
  @since 2.12