Here you can find the source of rangeInteger(Integer num, Integer min, Integer max)
public static Integer rangeInteger(Integer num, Integer min, Integer max)
//package com.java2s; public class Main { public static Integer rangeInteger(Integer num, Integer min, Integer max) { if (num == null) { return num; }//from w w w.java 2 s .co m if (num < min) { num = min; } if (num > max) { num = max; } return num; } }