/** * Verifies that the actual array starts with the given sequence of values, without any other values between them. * Similar to <code>{@link #containsSequence(double...)}</code>, but it also verifies that the first element in the * sequence is also first element of the actual array. * <p> * If you want to set a precision for the comparison either use {@link #startsWith(double[], Offset)} * or {@link #usingComparatorWithPrecision(Double)} before calling the assertion. * <p> * Example: * <pre><code class='java'> double[] values = new double[] { 1.0, 2.0, 3.0 }; * * // assertion will pass * assertThat(values).startsWith(1.0, 2.0) * .usingComparatorWithPrecision(0.5) * .startsWith(1.1, 2.1); * * // assertion will fail * assertThat(values).startsWith(2.0, 3.0);</code></pre> * * @param sequence the sequence of values to look for. * @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 start with the given sequence. */ public SELF startsWith(double... 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(double...)}</code>, but it also verifies that the first element in the * sequence is also first element of the actual array. * <p> * If you want to set a precision for the comparison either use {@link #startsWith(double[], Offset)} * or {@link #usingComparatorWithPrecision(Double)} before calling the assertion. * <p> * Example: * <pre><code class='java'> double[] values = new double[] { 1.0, 2.0, 3.0 }; * * // assertion will pass * assertThat(values).startsWith(1.0, 2.0) * .usingComparatorWithPrecision(0.5) * .startsWith(1.1, 2.1); * * // assertion will fail * assertThat(values).startsWith(2.0, 3.0);</code></pre> * * @param sequence the sequence of values to look for. * @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 start with the given sequence. */ public SELF startsWith(double... 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(double...)}</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 double[] { 1.0, 2.0, 3.0 }).startsWith(1.0, 2.0); * * // assertion will fail * assertThat(new double[] { 1.0, 2.0, 3.0 }).startsWith(2.0, 3.0); * </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(double... sequence) { arrays.assertStartsWith(info, actual, sequence); return myself; }