Here you can find the source of assertRange(String label, double value, double min, double max)
public static double assertRange(String label, double value, double min, double max)
//package com.java2s; //License from project: Apache License public class Main { public static double assertRange(String label, double value, double min, double max) { if (value < min || value > max) { throw new IllegalArgumentException( String.format("%s must be between %f and %f. Value was: %f", label, min, max, value)); }// www . j av a2 s . c om return value; } public static int assertRange(String label, int value, int min, int max) { if (value < min || value > max) { throw new IllegalArgumentException( String.format("%s must be between %d and %d. Value was: %d", label, min, max, value)); } return value; } }