/** * Verifies that the actual array contains the given values, in any order. * * <p>Example: * * <pre><code class='java'> // assertions will pass * assertThat(new long[] { 1L, 2L, 3L }).contains(1L, 2L); * assertThat(new long[] { 1L, 2L, 3L }).contains(3L, 1L); * assertThat(new long[] { 1L, 2L, 3L }).contains(1L, 3L, 2L); * * // assertions will fail * assertThat(new long[] { 1L, 2L, 3L }).contains(1L, 4L); * assertThat(new long[] { 1L, 2L, 3L }).contains(4L, 7L);</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. */ public S contains(long... values) { arrays.assertContains(info, actual, values); return myself; }
/** * Verifies that the actual array contains the given values, in any order. * * @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. */ public LongArrayAssert contains(long... values) { arrays.assertContains(info, actual, values); return this; }
/** * Verifies that the actual array contains the given value at the given index. * * <p>Example: * * <pre><code class='java'> // assertions will pass * assertThat(new long[] { 1L, 2L, 3L }).contains(1L, atIndex(O)); * assertThat(new long[] { 1L, 2L, 3L }).contains(3L, atIndex(2)); * * // assertions will fail * assertThat(new long[] { 1L, 2L, 3L }).contains(1L, atIndex(1)); * assertThat(new long[] { 1L, 2L, 3L }).contains(4L, atIndex(2));</code></pre> * * @param value the value to look for. * @param index the index where the value should be stored in the actual array. * @return myself 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 array. * @throws AssertionError if the actual array does not contain the given value at the given index. */ public S contains(long value, Index index) { arrays.assertContains(info, actual, value, index); return myself; }
/** * Verifies that the actual array contains the given value at the given index. * * @param value the value to look for. * @param index the index where the value 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 array. * @throws AssertionError if the actual array does not contain the given value at the given index. */ public LongArrayAssert contains(long value, Index index) { arrays.assertContains(info, actual, value, index); return this; }