* @return { r: IntRange | r.min = min && r.max = max }
* @throws IllegalArgumentException - min > max
*/
public static IntRange range(int min, int max) {
if (min < max) return new TwoPointRange(min,max);
else if (min==max) return new OnePointRange(min);
else throw new IllegalArgumentException("min > max");
}