/** * Verifies that the actual group contains the given values, in any order. * <p> * Example : * <pre><code class='java'> String[] abc = {"a", "b", "c"}; * * // assertions will pass * assertThat(abc).contains("b", "a"); * assertThat(abc).contains("b", "a", "b"); * * // assertions will fail * assertThat(abc).contains("d"); * assertThat(abc).contains("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 group is {@code null}. * @throws AssertionError if the actual group does not contain the given values. */ @Override public SELF contains(@SuppressWarnings("unchecked") ELEMENT... values) { arrays.assertContains(info, actual, values); return myself; }
/** * Verifies that the actual AtomicReferenceArray contains the given values, in any order. * <p> * Example : * <pre><code class='java'> AtomicReferenceArray<String> abc = new AtomicReferenceArray<>(new String[]{"a", "b", "c"}); * * // assertions will pass * assertThat(abc).contains("b", "a") * .contains("b", "a", "b"); * * // assertions will fail * assertThat(abc).contains("d"); * assertThat(abc).contains("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. * @since 2.7.0 / 3.7.0 */ @Override public AtomicReferenceArrayAssert<T> contains(@SuppressWarnings("unchecked") T... values) { arrays.assertContains(info, array, values); return myself; }
/** * Verifies that the actual AtomicReferenceArray contains the given object at the given index. * <p> * Example: * <pre><code class='java'> AtomicReferenceArray<Ring> elvesRings = new AtomicReferenceArray<>(new Ring[]{vilya, nenya, narya}); * * // assertions will pass * assertThat(elvesRings).contains(vilya, atIndex(0)) * .contains(nenya, atIndex(1)) * .contains(narya, atIndex(2)); * * // assertions will fail * assertThat(elvesRings).contains(vilya, atIndex(1)); * assertThat(elvesRings).contains(nenya, atIndex(2)); * assertThat(elvesRings).contains(narya, atIndex(0));</code></pre> * * @param value the object to look for. * @param index the index where the object should be stored in the actual AtomicReferenceArray. * @return this assertion object. * @throws AssertionError if the actual AtomicReferenceArray is {@code null} or empty. * @throws NullPointerException if the given {@code Index} is {@code null}. * @throws IndexOutOfBoundsException if the value of the given {@code Index} is equal to or greater than the size of the actual * AtomicReferenceArray. * @throws AssertionError if the actual AtomicReferenceArray does not contain the given object at the given index. */ @Override public AtomicReferenceArrayAssert<T> contains(T value, Index index) { arrays.assertContains(info, array, value, index); return myself; }
/** * Verifies that the actual array contains the given object at the given index. * <p> * Example: * <pre><code class='java'> Ring[] elvesRings = {vilya, nenya, narya}; * * // assertions will pass * assertThat(elvesRings).contains(vilya, atIndex(0)); * assertThat(elvesRings).contains(nenya, atIndex(1)); * assertThat(elvesRings).contains(narya, atIndex(2)); * * // assertions will fail * assertThat(elvesRings).contains(vilya, atIndex(1)); * assertThat(elvesRings).contains(nenya, atIndex(2)); * assertThat(elvesRings).contains(narya, atIndex(0));</code></pre> * * @param value the object to look for. * @param index the index where the object should be stored in the actual group. * @return this assertion object. * @throws AssertionError if the actual group is {@code null} or empty. * @throws NullPointerException if the given {@code Index} is {@code null}. * @throws IndexOutOfBoundsException if the value of the given {@code Index} is equal to or greater than the size of the actual * group. * @throws AssertionError if the actual group does not contain the given object at the given index. */ @Override public SELF contains(ELEMENT value, Index index) { arrays.assertContains(info, actual, value, index); return myself; }
/** * Verifies that the actual AtomicReferenceArray contains the given values, in any order. * <p> * Example : * <pre><code class='java'> AtomicReferenceArray<String> abc = new AtomicReferenceArray<>(new String[]{"a", "b", "c"}); * * // assertions will pass * assertThat(abc).contains("b", "a") * .contains("b", "a", "b"); * * // assertions will fail * assertThat(abc).contains("d"); * assertThat(abc).contains("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. * @since 2.7.0 / 3.7.0 */ @Override public AtomicReferenceArrayAssert<T> contains(@SuppressWarnings("unchecked") T... values) { arrays.assertContains(info, array, values); return myself; }
/** * Verifies that the actual array contains the given values, in any order. * <p> * Example : * <pre><code class='java'> String[] abc = {"a", "b", "c"}; * * // assertions will pass * assertThat(abc).contains("b", "a"); * assertThat(abc).contains("b", "a", "b"); * * // assertions will fail * assertThat(abc).contains("d"); * assertThat(abc).contains("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 array is {@code null}. * @throws AssertionError if the actual array does not contain the given values. */ @Override public SELF contains(@SuppressWarnings("unchecked") ELEMENT... values) { arrays.assertContains(info, actual, values); return myself; }
/** * Verifies that the actual AtomicReferenceArray contains the given object at the given index. * <p> * Example: * <pre><code class='java'> AtomicReferenceArray<Ring> elvesRings = new AtomicReferenceArray<>(new Ring[]{vilya, nenya, narya}); * * // assertions will pass * assertThat(elvesRings).contains(vilya, atIndex(0)) * .contains(nenya, atIndex(1)) * .contains(narya, atIndex(2)); * * // assertions will fail * assertThat(elvesRings).contains(vilya, atIndex(1)); * assertThat(elvesRings).contains(nenya, atIndex(2)); * assertThat(elvesRings).contains(narya, atIndex(0));</code></pre> * * @param value the object to look for. * @param index the index where the object should be stored in the actual AtomicReferenceArray. * @return this assertion object. * @throws AssertionError if the actual AtomicReferenceArray is {@code null} or empty. * @throws NullPointerException if the given {@code Index} is {@code null}. * @throws IndexOutOfBoundsException if the value of the given {@code Index} is equal to or greater than the size of the actual * AtomicReferenceArray. * @throws AssertionError if the actual AtomicReferenceArray does not contain the given object at the given index. */ @Override public AtomicReferenceArrayAssert<T> contains(T value, Index index) { arrays.assertContains(info, array, value, index); return myself; }
/** * Verifies that the actual array contains the given object at the given index. * <p> * Example: * <pre><code class='java'> Ring[] elvesRings = {vilya, nenya, narya}; * * // assertions will pass * assertThat(elvesRings).contains(vilya, atIndex(0)); * assertThat(elvesRings).contains(nenya, atIndex(1)); * assertThat(elvesRings).contains(narya, atIndex(2)); * * // assertions will fail * assertThat(elvesRings).contains(vilya, atIndex(1)); * assertThat(elvesRings).contains(nenya, atIndex(2)); * assertThat(elvesRings).contains(narya, atIndex(0));</code></pre> * * @param value the object to look for. * @param index the index where the object should be stored in the actual array. * @return this assertion object. * @throws AssertionError if the actual array is {@code null} or empty. * @throws NullPointerException if the given {@code Index} is {@code null}. * @throws IndexOutOfBoundsException if the value of the given {@code Index} is equal to or greater than the size of the actual * group. * @throws AssertionError if the actual array does not contain the given object at the given index. */ @Override public SELF contains(ELEMENT value, Index index) { arrays.assertContains(info, actual, value, index); return myself; }
/** {@inheritDoc} */ @Override public S contains(@SuppressWarnings("unchecked") T... values) { arrays.assertContains(info, actual, values); return myself; }
/** {@inheritDoc} */ @Override public S contains(T value, Index index) { arrays.assertContains(info, actual, value, index); return myself; }