code: public MonetaryFormat optionalDecimals(int... groups) {
          List<Integer> decimalGroups = new ArrayList<>(groups.length);
          for (int group : groups)
              decimalGroups.add(group);
          return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups,
                  shift, roundingMode, codes, codeSeparator, codePrefixed);
      }
docs: <p>
  Set additional groups of decimals to use after the minimum decimals, if they are useful for expressing precision.
  Each value is a number of decimals in that group. If the value precision exceeds all decimals specified
  (including minimum decimals), the value will be rounded. This configuration is not relevant for parsing.
  </p>
  
  <p>
  For example, if you pass {@code 4,2} it will add four decimals to your formatted string if needed, and then add
  another two decimals if needed. At this point, rather than adding further decimals the value will be rounded.
  </p>
  
  @param groups
  any number numbers of decimals, one for each group