public static <T> void setModel(JComboBox comboBox, DefaultComboBoxModel model, Collection<? extends T> values, Function<? super T, ? extends Pair<String, ?>> func) {
    model.removeAllElements();
    for (T each : values) {
      Pair<String, ?> pair = func.fun(each);
      addToModel(model, pair.second, pair.first);
    }
    comboBox.setModel(model);
  }
public static <T> void setModel(JComboBox comboBox, DefaultComboBoxModel model, Collection<? extends T> values, Function<? super T, ? extends Pair<String, ?>> func)