code: public GlobalizationPreferences setCollator(Collator collator) {
          if (isFrozen()) {
              throw new UnsupportedOperationException("Attempt to modify immutable object");
          }
          try {
              this.collator = (Collator) collator.clone(); // clone for safety
          } catch (CloneNotSupportedException e) {
                  throw new ICUCloneNotSupportedException("Error in cloning collator", e);
          }
          return this;
      }
docs: Explicitly set the collator for this object.
  @param collator The collator object to be passed.
  @return this, for chaining
  @hide draft / provisional / internal are hidden on Android