@Test public void testBetween0And1Long() { Assertions.assertThat(MathExt.between(0, 5, 10)).isEqualTo(5); Assertions.assertThat(MathExt.between(1, 2, 10)).isEqualTo(2); Assertions.assertThat(MathExt.between(5, 0, 10)).isEqualTo(5); }
public static double between(double value, double min, double max) { Preconditions.checkArgument(min <= max, "min must be less than or equal to max"); return Math.max(Math.min(value, max), min); }
MathExt { public static double between(double value, double min, double max) { Preconditions.checkArgument(min <= max, "min must be less than or equal to max"); return Math.max(Math.min(value, max), min); } }
MathExt { public static double between(double value, double min, double max) { Preconditions.checkArgument(min <= max, "min must be less than or equal to max"); return Math.max(Math.min(value, max), min); }  }
MathExt { public static double between(double value, double min, double max) { Preconditions.checkArgument(min <= max, "min must be less than or equal to max"); return Math.max(Math.min(value, max), min); }  static double scale(double value, double min, double max); static double scale(double value, double min, double max, double minRangeValue, double maxRangeValue); static double between(double value, double min, double max); static long between(long value, long min, long max); }
MathExt { public static double between(double value, double min, double max) { Preconditions.checkArgument(min <= max, "min must be less than or equal to max"); return Math.max(Math.min(value, max), min); }  static double scale(double value, double min, double max); static double scale(double value, double min, double max, double minRangeValue, double maxRangeValue); static double between(double value, double min, double max); static long between(long value, long min, long max);  }