/** * Verifies that the actual array starts with the given sequence of values, without any other values between them. * Similar to <code>{@link #containsSequence(byte...)}</code>, but it also verifies that the first element in the * sequence is also first element of the actual array. * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).startsWith((byte) 1, (byte) 2); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).startsWith((byte) 2, (byte) 3);</code></pre> * * @param sequence the sequence of values to look for. * @return myself 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 start with the given sequence. */ public SELF startsWith(byte... sequence) { arrays.assertStartsWith(info, actual, sequence); return myself; }
/** * Verifies that the actual array starts with the given sequence of values, without any other values between them. * Similar to <code>{@link #containsSequence(byte...)}</code>, but it also verifies that the first element in the * sequence is also first element of the actual array. * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).startsWith(1, 2); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).startsWith(2, 3);</code></pre> * * @param sequence the sequence of values to look for. * @return myself 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 start with the given sequence. * @since 2.6.0 / 3.6.0 */ public SELF startsWith(int... sequence) { arrays.assertStartsWith(info, actual, sequence); return myself; }
/** * Verifies that the actual array starts with the given sequence of values, without any other values between them. * Similar to <code>{@link #containsSequence(byte...)}</code>, but it also verifies that the first element in the * sequence is also first element of the actual array. * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).startsWith(1, 2); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).startsWith(2, 3);</code></pre> * * @param sequence the sequence of values to look for. * @return myself 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 start with the given sequence. * @since 2.6.0 / 3.6.0 */ public SELF startsWith(int... sequence) { arrays.assertStartsWith(info, actual, sequence); return myself; }
/** * Verifies that the actual array starts with the given sequence of values, without any other values between them. * Similar to <code>{@link #containsSequence(byte...)}</code>, but it also verifies that the first element in the * sequence is also first element of the actual array. * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).startsWith((byte) 1, (byte) 2); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).startsWith((byte) 2, (byte) 3);</code></pre> * * @param sequence the sequence of values to look for. * @return myself 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 start with the given sequence. */ public SELF startsWith(byte... sequence) { arrays.assertStartsWith(info, actual, sequence); return myself; }
/** * Verifies that the actual array starts with the given sequence of values, without any other values between them. * Similar to <code>{@link #containsSequence(byte...)}</code>, but it also verifies that the first element in the * sequence is also first element of the actual array. * <p> * Example: * * <pre><code class='java'> * // assertion will pass * assertThat(new byte[] { 1, 2, 3 }).startsWith(1, 2); * * // assertion will fail * assertThat(new byte[] { 1, 2, 3 }).startsWith(2, 3); * </code></pre> * * </p> * * @param sequence the sequence of values to look for. * @return myself 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 start with the given sequence. */ public S startsWith(byte... sequence) { arrays.assertStartsWith(info, actual, sequence); return myself; }