public static boolean areDropDownChoicesMergeable(
      SearchableFieldChoiceItem choice1, SearchableFieldChoiceItem choice2) {
    FieldSpec rawSpec1 = choice1.getSpec();
    FieldSpec rawSpec2 = choice2.getSpec();
    if (!rawSpec1.getType().isDropdown()) return false;
    if (!rawSpec2.getType().isDropdown()) return false;
    if (!rawSpec1.getTag().equals(rawSpec2.getTag())) return false;
    if (!rawSpec1.getLabel().equals(rawSpec2.getLabel())) return false;

    DropDownFieldSpec spec1 = (DropDownFieldSpec) rawSpec1;
    DropDownFieldSpec spec2 = (DropDownFieldSpec) rawSpec2;
    return Arrays.equals(spec1.getReusableChoicesCodes(), spec2.getReusableChoicesCodes());
  }
  public ListOfReusableChoicesLists getCurrentDropdownChoices(DropDownFieldSpec spec) {
    ChoiceItem[] choices = spec.getAllChoices();

    String[] reusableChoicesCodes = spec.getReusableChoicesCodes();
    UiGrid dataSource = getGrid(spec);
    if (dataSource != null) {
      choices = getDataDrivenChoices(spec, dataSource);
    } else if (reusableChoicesCodes.length > 0) {
      return getReusableChoicesLists(reusableChoicesCodes);
    }

    ReusableChoices onlyChoices = new ReusableChoices("", "");
    onlyChoices.addAll(choices);
    return new ListOfReusableChoicesLists(onlyChoices);
  }