public static int capBetween(int min,int number,int max){
  assertTrue(min <= max);
  return Math.min(max,Math.max(min,number));
}

public static int capBetween ( int min , int number , int max ) { assertTrue ( min <= max ) ; return Math . min ( max , Math . max ( min , number ) ) ; }
caps given number betwen given min and max , inclusive .
