/** * Verifies that there are <b>exactly</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"); * * // assertion will pass * oneTwoThree.areExactly(2, oddNumber); * * // assertions will fail * oneTwoThree.areExactly(1, oddNumber); * oneTwoThree.areExactly(3, oddNumber);</code></pre> * * @param times the exact number of times the condition should be 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 areExactly(int times, Condition<? super ELEMENT> condition) { arrays.assertAreExactly(info, actual, times, condition); return myself; }
/** * Verifies that there are <b>exactly</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"); * * // assertion will pass * oneThwoThree.areExactly(2, oddNumber); * * // assertions will fail * oneThwoThree.areExactly(1, oddNumber); * oneThwoThree.areExactly(3, oddNumber);</code></pre> * * @param times the exact number of times the condition should be 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> areExactly(int times, Condition<? super T> condition) { arrays.assertAreExactly(info, array, times, condition); return myself; }
/** * Verifies that there are <b>exactly</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"); * * // assertion will pass * oneThwoThree.areExactly(2, oddNumber); * * // assertions will fail * oneThwoThree.areExactly(1, oddNumber); * oneThwoThree.areExactly(3, oddNumber);</code></pre> * * @param times the exact number of times the condition should be 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> areExactly(int times, Condition<? super T> condition) { arrays.assertAreExactly(info, array, times, condition); return myself; }
/** * Verifies that there are <b>exactly</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"); * * // assertion will pass * oneTwoThree.areExactly(2, oddNumber); * * // assertions will fail * oneTwoThree.areExactly(1, oddNumber); * oneTwoThree.areExactly(3, oddNumber);</code></pre> * * @param times the exact number of times the condition should be 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 areExactly(int times, Condition<? super ELEMENT> condition) { arrays.assertAreExactly(info, actual, times, condition); return myself; }
/** {@inheritDoc} */ @Override public S areExactly(int times, Condition<? super T> condition) { arrays.assertAreExactly(info, actual, times, condition); return myself; }