code: @Override
      public RuleBasedCollator setMaxVariable(int group) {
          // Convert the reorder code into a MaxVariable number, or UCOL_DEFAULT=-1.
          int value;
          if(group == Collator.ReorderCodes.DEFAULT) {
              value = -1;  // UCOL_DEFAULT
          } else if(Collator.ReorderCodes.FIRST <= group && group <= Collator.ReorderCodes.CURRENCY) {
              value = group - Collator.ReorderCodes.FIRST;
          } else {
              throw new IllegalArgumentException("illegal max variable group " + group);
          }
          int oldValue = settings.readOnly().getMaxVariable();
          if(value == oldValue) {
              return this;
          }
          CollationSettings defaultSettings = getDefaultSettings();
          if(settings.readOnly() == defaultSettings) {
              if(value < 0) {  // UCOL_DEFAULT
                  return this;
              }
          }
          CollationSettings ownedSettings = getOwnedSettings();
  
          if(group == Collator.ReorderCodes.DEFAULT) {
              group = Collator.ReorderCodes.FIRST + defaultSettings.getMaxVariable();
          }
          long varTop = data.getLastPrimaryForGroup(group);
          assert(varTop != 0);
          ownedSettings.setMaxVariable(value, defaultSettings.options);
          ownedSettings.variableTop = varTop;
          setFastLatinOptions(ownedSettings);
          return this;
      }
docs: <strong>[icu]</strong> Sets the variable top to the top of the specified reordering group.
  The variable top determines the highest-sorting character
  which is affected by the alternate handling behavior.
  If that attribute is set to NON_IGNORABLE, then the variable top has no effect.
  @param group one of Collator.ReorderCodes.SPACE, Collator.ReorderCodes.PUNCTUATION,
  Collator.ReorderCodes.SYMBOL, Collator.ReorderCodes.CURRENCY;
  or Collator.ReorderCodes.DEFAULT to restore the default max variable group
  @return this
  @see #getMaxVariable