arrays.assertContainsOnly(info, actual, values); return myself;
arrays.assertContainsOnly(info, actual, values); return myself;
/** * Verifies that the actual array contains only the given values and nothing else, in any order. * <p> * Examples : * * <pre><code class='java'> * // assertion will pass * assertThat(new double[] { 1.0, 2.0, 3.0 }).containsOnly(1.0, 2.0, 3.0); * assertThat(new double[] { 1.0, 2.0, 3.0 }).containsOnly(2.0, 3.0, 1.0); * * // assertions will fail * assertThat(new double[] { 1.0, 2.0, 3.0 }).containsOnly(1.0, 4.0, 2.0, 3.0); * assertThat(new double[] { 1.0, 2.0, 3.0 }).containsOnly(4.0, 7.0); * </code></pre> * * </p> * * @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, i.e. the actual array contains some * or none of the given values, or the actual array contains more values than the given ones. */ public S containsOnly(double... values) { arrays.assertContainsOnly(info, actual, values); return myself; }