Here you can find the source of inRange(final int value, final int min, final int max)
private static int inRange(final int value, final int min, final int max)
//package com.java2s; //License from project: Open Source License public class Main { private static int inRange(final int value, final int min, final int max) { return Math.max(Math.min(value, max), min); }//from w w w .j a v a2 s . c o m }