/** * Verifies that there are <b>at most</b> <i>n</i> elements in the actual group satisfying the given condition. * <p> * Example : * <pre><code class='java'> int[] oneTwoThree = {1, 2, 3}; * * Condition<Integer> oddNumber = new Condition<>(value % 2 == 1, "odd number"); * * // assertions will pass * oneTwoThree.areAtMost(2, oddNumber); * oneTwoThree.areAtMost(3, oddNumber); * * // assertion will fail * oneTwoThree.areAtMost(1, oddNumber);</code></pre> * * @param times the number of times the condition should be at most verified. * @param condition the given condition. * @return {@code this} object. * @throws NullPointerException if the given condition is {@code null}. * @throws AssertionError if an element cannot be cast to ELEMENT. * @throws AssertionError if the number of elements satisfying the given condition is > n. */ @Override public SELF areAtMost(int times, Condition<? super ELEMENT> condition) { arrays.assertAreAtMost(info, actual, times, condition); return myself; }
/** * Verifies that there are <b>at most</b> <i>n</i> elements in the actual AtomicReferenceArray satisfying the given condition. * <p> * Example : * <pre><code class='java'> AtomicReferenceArray<Integer> oneThwoThree = new AtomicReferenceArray<>(new Integer[]{1, 2, 3}); * * Condition<Integer> oddNumber = new Condition<>(value % 2 == 1, "odd number"); * * // assertions will pass * oneThwoThree.areAtMost(2, oddNumber); * oneThwoThree.areAtMost(3, oddNumber); * * // assertion will fail * oneThwoThree.areAtMost(1, oddNumber);</code></pre> * * @param times the number of times the condition should be at most verified. * @param condition the given condition. * @return {@code this} object. * @throws NullPointerException if the given condition is {@code null}. * @throws AssertionError if an element cannot be cast to T. * @throws AssertionError if the number of elements satisfying the given condition is > n. */ @Override public AtomicReferenceArrayAssert<T> areAtMost(int times, Condition<? super T> condition) { arrays.assertAreAtMost(info, array, times, condition); return myself; }
/** * Verifies that there are <b>at most</b> <i>n</i> elements in the actual array satisfying the given condition. * <p> * Example : * <pre><code class='java'> int[] oneTwoThree = {1, 2, 3}; * * Condition<Integer> oddNumber = new Condition<>(value % 2 == 1, "odd number"); * * // assertions will pass * oneTwoThree.areAtMost(2, oddNumber); * oneTwoThree.areAtMost(3, oddNumber); * * // assertion will fail * oneTwoThree.areAtMost(1, oddNumber);</code></pre> * * @param times the number of times the condition should be at most verified. * @param condition the given condition. * @return {@code this} object. * @throws NullPointerException if the given condition is {@code null}. * @throws AssertionError if an element cannot be cast to ELEMENT. * @throws AssertionError if the number of elements satisfying the given condition is > n. */ @Override public SELF areAtMost(int times, Condition<? super ELEMENT> condition) { arrays.assertAreAtMost(info, actual, times, condition); return myself; }
/** * Verifies that there are <b>at most</b> <i>n</i> elements in the actual AtomicReferenceArray satisfying the given condition. * <p> * Example : * <pre><code class='java'> AtomicReferenceArray<Integer> oneThwoThree = new AtomicReferenceArray<>(new Integer[]{1, 2, 3}); * * Condition<Integer> oddNumber = new Condition<>(value % 2 == 1, "odd number"); * * // assertions will pass * oneThwoThree.areAtMost(2, oddNumber); * oneThwoThree.areAtMost(3, oddNumber); * * // assertion will fail * oneThwoThree.areAtMost(1, oddNumber);</code></pre> * * @param times the number of times the condition should be at most verified. * @param condition the given condition. * @return {@code this} object. * @throws NullPointerException if the given condition is {@code null}. * @throws AssertionError if an element cannot be cast to T. * @throws AssertionError if the number of elements satisfying the given condition is > n. */ @Override public AtomicReferenceArrayAssert<T> areAtMost(int times, Condition<? super T> condition) { arrays.assertAreAtMost(info, array, times, condition); return myself; }
/** {@inheritDoc} */ @Override public S areAtMost(int times, Condition<? super T> condition) { arrays.assertAreAtMost(info, actual, times, condition); return myself; }