}
};
}
private void resetIfCurrentNotInChoices(final Select2Choice<ObjectAdapterMemento> select2Field, final List<ObjectAdapterMemento> choiceMementos) {
final ObjectAdapterMemento curr = select2Field.getModelObject();
if(curr == null || !curr.containedIn(choiceMementos)) {
if(!choiceMementos.isEmpty()) {
final ObjectAdapterMemento newAdapterMemento = choiceMementos.get(0);
select2Field.getModel().setObject(newAdapterMemento);
getModel().setObject(newAdapterMemento.getObjectAdapter(ConcurrencyChecking.NO_CHECK));
} else {
select2Field.getModel().setObject(null);
getModel().setObject(null);
}
}