// sets value to number closest to existing value
static void spinnerSetNumberList(JSpinner spinner, L list) swing {
double value = toDouble(spinner.getValue());
spinner.setModel(new SpinnerListModel(list));
setSpinnerValue(spinner, lowestByScoreFunction(list, x -> absDiff(toDouble(x), value)));
}