private AttributeSchemaImpl checkAndUpdateChoiceValues(AttributeSchemaImpl existingAttr,AttributeSchemaImpl newAttr,List<String> newChoices) throws UpgradeException {
  List<String> choices=new ArrayList<>(Arrays.asList(existingAttr.getChoiceValues()));
  if (choices.containsAll(newChoices)) {
    return null;
  }
 else {
    choices.addAll(newChoices);
    updateChoiceValues(newAttr,choices);
  }
  return newAttr;
}

private AttributeSchemaImpl checkAndUpdateChoiceValues ( AttributeSchemaImpl existingAttr , AttributeSchemaImpl newAttr , List < String > newChoices ) throws UpgradeException { List < String > choices = new ArrayList < > ( Arrays . asList ( existingAttr . getChoiceValues ( ) ) ) ; if ( choices . containsAll ( newChoices ) ) { return null ; } else { choices . addAll ( newChoices ) ; updateChoiceValues ( newAttr , choices ) ; } return newAttr ; }
checks whether the given attribute already contains all of the given choice values , and if not upgrades it .
