/** * Verifies that the actual array contains the given subsequence (possibly with other values between them). * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(1, 2, 3); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(1, 2); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(1, 3); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(2, 3); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(2, 1); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(4, 7);</code></pre> * * @param subsequence the subsequence 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 subsequence. * @since 2.6.0 / 3.6.0 */ public SELF containsSubsequence(int... subsequence) { arrays.assertContainsSubsequence(info, actual, subsequence); return myself; }
/** * Verifies that the actual array contains the given subsequence (possibly with other values between them). * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence((byte) 1, (byte) 2, (byte) 3); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence((byte) 1, (byte) 2); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence((byte) 1, (byte) 3); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence((byte) 2, (byte) 3); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence((byte) 2, (byte) 1); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence((byte) 4, (byte) 7);</code></pre> * * @param subsequence the subsequence 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 subsequence. */ public SELF containsSubsequence(byte... subsequence) { arrays.assertContainsSubsequence(info, actual, subsequence); return myself; }
/** * Verifies that the actual array contains the given subsequence (possibly with other values between them). * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence((byte) 1, (byte) 2, (byte) 3); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence((byte) 1, (byte) 2); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence((byte) 1, (byte) 3); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence((byte) 2, (byte) 3); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence((byte) 2, (byte) 1); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence((byte) 4, (byte) 7);</code></pre> * * @param subsequence the subsequence 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 subsequence. */ public SELF containsSubsequence(byte... subsequence) { arrays.assertContainsSubsequence(info, actual, subsequence); return myself; }
/** * Verifies that the actual array contains the given subsequence (possibly with other values between them). * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(1, 2, 3); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(1, 2); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(1, 3); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(2, 3); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(2, 1); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(4, 7);</code></pre> * * @param subsequence the subsequence 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 subsequence. * @since 2.6.0 / 3.6.0 */ public SELF containsSubsequence(int... subsequence) { arrays.assertContainsSubsequence(info, actual, subsequence); return myself; }
/** * Verifies that the actual array contains the given subsequence (possibly with other values between them). * <p> * Example: * * <pre><code class='java'> * // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(1, 2, 3); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(1, 2); * assertThat(new byte[] { 1, 2, 3 }).containsSubsubsequence(1, 3); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(2, 3); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(2, 1); * assertThat(new byte[] { 1, 2, 3 }).containsSubsequence(4, 7); * </code></pre> * * </p> * * @param subsequence the subsequence 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 subsequence. */ public S containsSubsequence(byte... subsequence) { arrays.assertContainsSubsequence(info, actual, subsequence); return myself; }