public static void assertInRangeInclusive(
      long actual, long expectedMinValue, long expectedMaxValue) {
    if ((actual < expectedMinValue) || (actual > expectedMaxValue)) {
      Assert.fail(actual + " not in [" + expectedMinValue + ", " + expectedMaxValue + "]");
    }
  }
Asserts that the actual value is in the expected range (inclusive).
javatests/com/google/android/apps/authenticator/testing/TestUtilities.java