public static void checkWithinRange(
      long value,
      String valueName,
      long minValueInclusive,
      long maxValueInclusive) {
    checkArgument(
        (value >= minValueInclusive) && (value <= maxValueInclusive),
        "'%s' (%s) must be within the range [%s, %s].",
        valueName,
        value,
        minValueInclusive,
        maxValueInclusive);
  }
@Test
  public void testCheckWithinRange() throws Exception {
    // Should not throw.
    Validate.checkWithinRange(10, "arg", 5, 15);
    Validate.checkWithinRange(10.0, "arg", 5.0, 15.0);

    // Verify it throws.

    intercept(IllegalArgumentException.class,
        "'arg' (5) must be within the range [10, 20]",
        () -> Validate.checkWithinRange(5, "arg", 10, 20));

    intercept(IllegalArgumentException.class,
        "'arg' (5.0) must be within the range [10.0, 20.0]",
        () -> Validate.checkWithinRange(5.0, "arg", 10.0, 20.0));

  }