void checkMinElements(String name, List<double> arr) { invariant(arr.length >= 2, ['%s must have at least 2 elements. (%s)', name, arr.toString()]); }