/** * Verifies that the actual array contains the given sequence, without any other values between them. * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).containsSequence(1, 2); * assertThat(new byte[] { 1, 2, 3 }).containsSequence(1, 2, 3); * assertThat(new byte[] { 1, 2, 3 }).containsSequence(2, 3); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).containsSequence(1, 3); * assertThat(new byte[] { 1, 2, 3 }).containsSequence(4, 7);</code></pre> * * @param sequence the sequence of values to look for. * @return myself assertion object. * @throws AssertionError if the actual array is {@code null}. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the actual array does not contain the given sequence. * @since 2.6.0 / 3.6.0 */ public SELF containsSequence(int... sequence) { arrays.assertContainsSequence(info, actual, sequence); return myself; }
/** * Verifies that the actual array contains the given sequence, without any other values between them. * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).containsSequence((byte) 1, (byte) 2); * assertThat(new byte[] { 1, 2, 3 }).containsSequence((byte) 1, (byte) 2, (byte) 3); * assertThat(new byte[] { 1, 2, 3 }).containsSequence((byte) 2, (byte) 3); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).containsSequence((byte) 1, (byte) 3); * assertThat(new byte[] { 1, 2, 3 }).containsSequence((byte) 4, (byte) 7);</code></pre> * * @param sequence the sequence of values to look for. * @return myself assertion object. * @throws AssertionError if the actual array is {@code null}. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the actual array does not contain the given sequence. */ public SELF containsSequence(byte... sequence) { arrays.assertContainsSequence(info, actual, sequence); return myself; }
/** * Verifies that the actual array contains the given sequence, without any other values between them. * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).containsSequence(1, 2); * assertThat(new byte[] { 1, 2, 3 }).containsSequence(1, 2, 3); * assertThat(new byte[] { 1, 2, 3 }).containsSequence(2, 3); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).containsSequence(1, 3); * assertThat(new byte[] { 1, 2, 3 }).containsSequence(4, 7);</code></pre> * * @param sequence the sequence of values to look for. * @return myself assertion object. * @throws AssertionError if the actual array is {@code null}. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the actual array does not contain the given sequence. * @since 2.6.0 / 3.6.0 */ public SELF containsSequence(int... sequence) { arrays.assertContainsSequence(info, actual, sequence); return myself; }
/** * Verifies that the actual array contains the given sequence, without any other values between them. * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).containsSequence((byte) 1, (byte) 2); * assertThat(new byte[] { 1, 2, 3 }).containsSequence((byte) 1, (byte) 2, (byte) 3); * assertThat(new byte[] { 1, 2, 3 }).containsSequence((byte) 2, (byte) 3); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).containsSequence((byte) 1, (byte) 3); * assertThat(new byte[] { 1, 2, 3 }).containsSequence((byte) 4, (byte) 7);</code></pre> * * @param sequence the sequence of values to look for. * @return myself assertion object. * @throws AssertionError if the actual array is {@code null}. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the actual array does not contain the given sequence. */ public SELF containsSequence(byte... sequence) { arrays.assertContainsSequence(info, actual, sequence); return myself; }
/** * Verifies that the actual array contains the given sequence, without any other values between them. * <p> * Example: * * <pre><code class='java'> * // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).containsSequence(1, 2); * assertThat(new byte[] { 1, 2, 3 }).containsSequence(1, 2, 3); * assertThat(new byte[] { 1, 2, 3 }).containsSequence(2, 3); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).containsSequence(1, 3); * assertThat(new byte[] { 1, 2, 3 }).containsSequence(4, 7); * </code></pre> * * </p> * * @param sequence the sequence of values to look for. * @return myself assertion object. * @throws AssertionError if the actual array is {@code null}. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the actual array does not contain the given sequence. */ public S containsSequence(byte... sequence) { arrays.assertContainsSequence(info, actual, sequence); return myself; }