/** * Asserts that the number of entries in the given {@code Map} is between the given lower and higher boundary (inclusive). * * @param info contains information about the assertion. * @param actual the given {@code Map}. * @param lowerBoundary the lower boundary compared to which actual size should be greater than or equal to. * @param higherBoundary the higher boundary compared to which actual size should be less than or equal to. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the number of elements in the given array is not between the boundaries. */ public void assertHasSizeBetween(AssertionInfo info, Map<?, ?> actual, int lowerBoundary, int higherBoundary) { assertNotNull(info, actual); checkSizeBetween(actual, lowerBoundary, higherBoundary, actual.size(), info); }
/** * Asserts that the size of the given {@code CharSequence} is between the given lower and higher boundary (inclusive). * * @param info contains information about the assertion. * @param actual the given {@code Iterable}. * @param lowerBoundary the lower boundary compared to which actual size should be greater than or equal to. * @param higherBoundary the higher boundary compared to which actual size should be less than or equal to. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the number of elements in the given array is not between the boundaries. */ public void assertHasSizeBetween(AssertionInfo info, CharSequence actual, int lowerBoundary, int higherBoundary) { assertNotNull(info, actual); checkSizeBetween(actual, actual.length(), lowerBoundary, higherBoundary, info); }
void assertHasSizeBetween(AssertionInfo info, Object array, int lowerBoundary, int higherBoundary) { assertNotNull(info, array); int sizeOfActual = sizeOf(array); checkSizeBetween(array, lowerBoundary, higherBoundary, sizeOfActual, info); }
/** * Asserts that the number of elements in the given {@code Iterable} is between the given lower and higher boundary (inclusive). * * @param info contains information about the assertion. * @param actual the given {@code Iterable}. * @param lowerBoundary the lower boundary compared to which actual size should be greater than or equal to. * @param higherBoundary the higher boundary compared to which actual size should be less than or equal to. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the number of elements in the given array is not between the boundaries. */ public void assertHasSizeBetween(AssertionInfo info, Iterable<?> actual, int lowerBoundary, int higherBoundary) { assertNotNull(info, actual); checkSizeBetween(actual, lowerBoundary, higherBoundary, sizeOf(actual), info); }