/** * Verifies that the actual AtomicReferenceArray contains only the given values and nothing else, <b>in any order</b> and ignoring duplicates (i.e. once a value is found, its duplicates are also considered found).. * <p> * Example : * <pre><code class='java'> AtomicReferenceArray<String> abc = new AtomicReferenceArray<>(new String[]{"a", "b", "c"}); * * // assertions will pass * assertThat(abc).containsOnly("c", "b", "a") * .containsOnly("a", "a", "b", "c", "c"); * * // assertion will fail because "c" is missing from the given values * assertThat(abc).containsOnly("a", "b"); * // assertion will fail because abc does not contain "d" * assertThat(abc).containsOnly("a", "b", "c", "d");</code></pre> * * @param values the given values. * @return {@code this} assertion object. * @throws NullPointerException if the given argument is {@code null}. * @throws IllegalArgumentException if the given argument is an empty array. * @throws AssertionError if the actual AtomicReferenceArray is {@code null}. * @throws AssertionError if the actual AtomicReferenceArray does not contain the given values, i.e. the actual AtomicReferenceArray contains some * or none of the given values, or the actual AtomicReferenceArray contains more values than the given ones. * @since 2.7.0 / 3.7.0 */ @Override public AtomicReferenceArrayAssert<T> containsOnly(@SuppressWarnings("unchecked") T... values) { arrays.assertContainsOnly(info, array, values); return myself; }
arrays.assertContainsOnly(info, actual, values); return myself;
/** * Verifies that the actual AtomicReferenceArray contains only the given values and nothing else, <b>in any order</b> and ignoring duplicates (i.e. once a value is found, its duplicates are also considered found).. * <p> * Example : * <pre><code class='java'> AtomicReferenceArray<String> abc = new AtomicReferenceArray<>(new String[]{"a", "b", "c"}); * * // assertions will pass * assertThat(abc).containsOnly("c", "b", "a") * .containsOnly("a", "a", "b", "c", "c"); * * // assertion will fail because "c" is missing from the given values * assertThat(abc).containsOnly("a", "b"); * // assertion will fail because abc does not contain "d" * assertThat(abc).containsOnly("a", "b", "c", "d");</code></pre> * * @param values the given values. * @return {@code this} assertion object. * @throws NullPointerException if the given argument is {@code null}. * @throws IllegalArgumentException if the given argument is an empty array. * @throws AssertionError if the actual AtomicReferenceArray is {@code null}. * @throws AssertionError if the actual AtomicReferenceArray does not contain the given values, i.e. the actual AtomicReferenceArray contains some * or none of the given values, or the actual AtomicReferenceArray contains more values than the given ones. * @since 2.7.0 / 3.7.0 */ @Override public AtomicReferenceArrayAssert<T> containsOnly(@SuppressWarnings("unchecked") T... values) { arrays.assertContainsOnly(info, array, values); return myself; }
arrays.assertContainsOnly(info, actual, values); return myself;
/** {@inheritDoc} */ @Override public S containsOnly(@SuppressWarnings("unchecked") T... values) { arrays.assertContainsOnly(info, actual, values); return myself; }