options.addAll(group.options);   if (optionGroups.isEmpty()) optionGroups.add(group); else optionGroups.add(optionGroups.size() - 1, group);
options.add(opt); defaultGroup.add(opt);
  public synchronized void add(OptionGroup group)  {    options.addAll(group.options);    // This ensures that the final group always appears at the end    // of the options.    if (optionGroups.isEmpty())      optionGroups.add(group);    else      optionGroups.add(optionGroups.size() - 1, group);  }