Class AbstractBooleanArrayAssert<SELF extends AbstractBooleanArrayAssert<SELF>>

java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
org.assertj.core.api.AbstractEnumerableAssert<SELF,ACTUAL,ELEMENT>
org.assertj.core.api.AbstractArrayAssert<SELF,boolean[],Boolean>
org.assertj.core.api.AbstractBooleanArrayAssert<SELF>
All Implemented Interfaces:
ArraySortedAssert<AbstractArrayAssert<SELF,boolean[],Boolean>,Boolean>, Assert<SELF,boolean[]>, Descriptable<SELF>, EnumerableAssert<AbstractEnumerableAssert<SELF,boolean[],Boolean>,Boolean>, ExtensionPoints<SELF,boolean[]>
Direct Known Subclasses:
BooleanArrayAssert

public abstract class AbstractBooleanArrayAssert<SELF extends AbstractBooleanArrayAssert<SELF>> extends AbstractArrayAssert<SELF,boolean[],Boolean>
  • Field Details

    • arrays

      protected org.assertj.core.internal.BooleanArrays arrays
  • Constructor Details

    • AbstractBooleanArrayAssert

      protected AbstractBooleanArrayAssert(boolean[] actual, Class<?> selfType)
  • Method Details

    • isNullOrEmpty

      public void isNullOrEmpty()
      Verifies that the actual group of values is null or empty.

      Example:

       // assertions will pass
       List<String> strings = new ArrayList<>();
       assertThat(strings).isNullOrEmpty();
       assertThat(new int[] { }).isNullOrEmpty();
      
       // assertions will fail
       assertThat(new String[] { "a", "b"}).isNullOrEmpty();
       assertThat(Arrays.asList(1, 2, 3)).isNullOrEmpty();
    • isEmpty

      public void isEmpty()
      Verifies that the actual group of values is empty.

      Example:

       // assertions will pass
       assertThat(new ArrayList()).isEmpty();
       assertThat(new int[] { }).isEmpty();
      
       // assertions will fail
       assertThat(new String[] { "a", "b" }).isEmpty();
       assertThat(Arrays.asList(1, 2, 3)).isEmpty();
    • isNotEmpty

      public SELF isNotEmpty()
      Verifies that the actual group of values is not empty.

      Example:

       // assertions will pass
       assertThat(new String[] { "a", "b" }).isNotEmpty();
       assertThat(Arrays.asList(1, 2, 3)).isNotEmpty();
      
       // assertions will fail
       assertThat(new ArrayList()).isNotEmpty();
       assertThat(new int[] { }).isNotEmpty();
      Returns:
      this assertion object.
    • hasSize

      public SELF hasSize(int expected)
      Verifies that the number of values in the actual group is equal to the given one.

      Example:

       // assertions will pass
       assertThat(new String[] { "a", "b" }).hasSize(2);
       assertThat(Arrays.asList(1, 2, 3)).hasSize(3);
      
       // assertions will fail
       assertThat(new ArrayList()).hasSize(1);
       assertThat(new int[] { 1, 2, 3 }).hasSize(2);

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).hasSize(2);
      
       // assertion will fail
       assertThat(new boolean[] { true }).hasSize(2);
      Parameters:
      expected - the expected number of values in the actual group.
      Returns:
      this assertion object.
    • hasSizeGreaterThan

      public SELF hasSizeGreaterThan(int boundary)
      Verifies that the number of values in the actual group is greater than the given boundary.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).hasSizeGreaterThan(1);
      
       // assertion will fail
       assertThat(new boolean[] { true }).hasSizeGreaterThan(1);
      Parameters:
      boundary - the given value to compare the actual size to.
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the number of values of the actual array is not greater than the boundary.
      Since:
      3.12.0
    • hasSizeGreaterThanOrEqualTo

      public SELF hasSizeGreaterThanOrEqualTo(int boundary)
      Verifies that the number of values in the actual group is greater than or equal to the given boundary.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).hasSizeGreaterThanOrEqualTo(1)
                                                .hasSizeGreaterThanOrEqualTo(2);
      
       // assertion will fail
       assertThat(new boolean[] { true }).hasSizeGreaterThanOrEqualTo(2);
      Parameters:
      boundary - the given value to compare the actual size to.
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the number of values of the actual array is not greater than or equal to the boundary.
      Since:
      3.12.0
    • hasSizeLessThan

      public SELF hasSizeLessThan(int boundary)
      Verifies that the number of values in the actual group is less than the given boundary.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).hasSizeLessThan(3);
      
       // assertion will fail
       assertThat(new boolean[] { true, false }).hasSizeLessThan(1);
      Parameters:
      boundary - the given value to compare the actual size to.
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the number of values of the actual array is not less than the boundary.
      Since:
      3.12.0
    • hasSizeLessThanOrEqualTo

      public SELF hasSizeLessThanOrEqualTo(int boundary)
      Verifies that the number of values in the actual group is less than or equal to the given boundary.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).hasSizeLessThanOrEqualTo(3)
                                                .hasSizeLessThanOrEqualTo(2);
      
       // assertion will fail
       assertThat(new boolean[] { true, false }).hasSizeLessThanOrEqualTo(1);
      Parameters:
      boundary - the given value to compare the actual size to.
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the number of values of the actual array is not less than or equal to the boundary.
      Since:
      3.12.0
    • hasSizeBetween

      public SELF hasSizeBetween(int lowerBoundary, int higherBoundary)
      Verifies that the number of values in the actual group is between the given boundaries (inclusive).

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).hasSizeBetween(1, 3)
                                                .hasSizeBetween(2, 2);
      
       // assertion will fail
       assertThat(new boolean[] { true, false }).hasSizeBetween(4, 5);
      Parameters:
      lowerBoundary - the lower boundary compared to which actual size should be greater than or equal to.
      higherBoundary - the higher boundary compared to which actual size should be less than or equal to.
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the number of values of the actual array is not between the boundaries.
      Since:
      3.12.0
    • hasSameSizeAs

      public SELF hasSameSizeAs(Iterable<?> other)
      Verifies that the actual group has the same size as given Iterable.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).hasSameSizeAs(Arrays.asList(1, 2));
      
       // assertion will fail
       assertThat(new boolean[] { true, false }).hasSameSizeAs(Arrays.asList(1, 2, 3));
      Parameters:
      other - the Iterable to compare size with actual group.
      Returns:
      this assertion object.
    • contains

      public SELF contains(boolean... values)
      Verifies that the actual array contains the given values, in any order.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).contains(true, false);
       assertThat(new boolean[] { false, true }).contains(true, false);
       assertThat(new boolean[] { true, false }).contains(true);
      
       // assertion will fail
       assertThat(new boolean[] { true, true }).contains(false);
      Parameters:
      values - the given values.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      IllegalArgumentException - if the given argument is an empty array.
      AssertionError - if the actual array is null.
      AssertionError - if the actual array does not contain the given values.
    • contains

      public SELF contains(Boolean[] values)
      Verifies that the actual array contains the values of the given array, in any order.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).contains(new Boolean[] { true, false });
       assertThat(new boolean[] { false, true }).contains(new Boolean[] { true, false });
       assertThat(new boolean[] { true, false }).contains(new Boolean[] { true });
      
       // assertion will fail
       assertThat(new boolean[] { true, true }).contains(new Boolean[] { false });
      Parameters:
      values - the given values.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      IllegalArgumentException - if the given argument is an empty array.
      AssertionError - if the actual array is null.
      AssertionError - if the actual array does not contain the given values.
      Since:
      3.19.0
    • containsOnly

      public SELF containsOnly(boolean... values)
      Verifies that the actual array contains only the given values and nothing else, in any order.

      Example:

       // assertions will pass
       assertThat(new boolean[] { true, false }).containsOnly(true, false);
       assertThat(new boolean[] { false, true }).containsOnly(true, false);
       assertThat(new boolean[] { true, true, false }).containsOnly(true, false);
      
       // assertions will fail
       assertThat(new boolean[] { true, false }).containsOnly(false);
       assertThat(new boolean[] { true }).containsOnly(true, false);
      Parameters:
      values - the given values.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      IllegalArgumentException - if the given argument is an empty array.
      AssertionError - if the actual array is null.
      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.
    • containsOnly

      public SELF containsOnly(Boolean[] values)
      Verifies that the actual array contains only the values of the given array and nothing else, in any order.

      Example:

       // assertions will pass
       assertThat(new boolean[] { true, false }).containsOnly(new Boolean[] { true, false });
       assertThat(new boolean[] { false, true }).containsOnly(new Boolean[] { true, false });
       assertThat(new boolean[] { true, true, false }).containsOnly(new Boolean[] { true, false });
      
       // assertions will fail
       assertThat(new boolean[] { true, false }).containsOnly(new Boolean[] { false });
       assertThat(new boolean[] { true }).containsOnly(new Boolean[] { true, false });
      Parameters:
      values - the given values.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      IllegalArgumentException - if the given argument is an empty array.
      AssertionError - if the actual array is null.
      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.
    • containsOnlyOnce

      public SELF containsOnlyOnce(boolean... values)
      Verifies that the actual array contains the given values only once.

      Examples :

       // assertion will pass
       assertThat(new boolean[] { true, false }).containsOnlyOnce(true, false);
      
       // assertions will fail
       assertThat(new boolean[] { true, false, true }).containsOnlyOnce(true);
       assertThat(new boolean[] { true }).containsOnlyOnce(false);
       assertThat(new boolean[] { true }).containsOnlyOnce(true, false);
      Parameters:
      values - the given values.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      IllegalArgumentException - if the given argument is an empty array.
      AssertionError - if the actual array is null.
      AssertionError - if the actual group does not contain the given values, i.e. the actual group contains some or none of the given values, or the actual group contains more than once these values.
    • containsOnlyOnce

      public SELF containsOnlyOnce(Boolean[] values)
      Verifies that the actual array contains the values of the given array only once.

      Examples :

       // assertion will pass
       assertThat(new boolean[] { true, false }).containsOnlyOnce(new Boolean[] { true, false });
      
       // assertions will fail
       assertThat(new boolean[] { true, false, true }).containsOnlyOnce(new Boolean[] { true });
       assertThat(new boolean[] { true }).containsOnlyOnce(new Boolean[] { false });
       assertThat(new boolean[] { true }).containsOnlyOnce(new Boolean[] { true, false });
      Parameters:
      values - the given values.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      IllegalArgumentException - if the given argument is an empty array.
      AssertionError - if the actual array is null.
      AssertionError - if the actual group does not contain the given values, i.e. the actual group contains some or none of the given values, or the actual group contains more than once these values.
    • containsSequence

      public SELF containsSequence(boolean... sequence)
      Verifies that the actual array contains the given sequence, without any other values between them.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).containsSequence(true, false);
       assertThat(new boolean[] { true, false, false, true }).containsSequence(false, true);
      
       // assertion will fail
       assertThat(new boolean[] { true, true, false }).containsSequence(false, true);
      Parameters:
      sequence - the sequence of values to look for.
      Returns:
      myself assertion object.
      Throws:
      AssertionError - if the actual array is null.
      AssertionError - if the given array is null.
      AssertionError - if the actual array does not contain the given sequence.
    • containsSequence

      public SELF containsSequence(Boolean[] sequence)
      Verifies that the actual array contains the given sequence, without any other values between them.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).containsSequence(new Boolean[] { true, false });
       assertThat(new boolean[] { true, false, false, true }).containsSequence(new Boolean[] { false, true });
      
       // assertion will fail
       assertThat(new boolean[] { true, true, false }).containsSequence(new Boolean[] { false, true });
      Parameters:
      sequence - the sequence of values to look for.
      Returns:
      myself assertion object.
      Throws:
      AssertionError - if the actual array is null.
      AssertionError - if the given array is null.
      AssertionError - if the actual array does not contain the given sequence.
    • containsSubsequence

      public SELF containsSubsequence(boolean... subsequence)
      Verifies that the actual array contains the given subsequence (possibly with other values between them).

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).containsSubsequence(true, false);
       assertThat(new boolean[] { true, false, false, true }).containsSubsequence(true, true);
      
       // assertion will fail
       assertThat(new boolean[] { true, true, false }).containsSubsequence(false, true);
      Parameters:
      subsequence - the subsequence of values to look for.
      Returns:
      myself assertion object.
      Throws:
      AssertionError - if the actual array is null.
      AssertionError - if the given array is null.
      AssertionError - if the actual array does not contain the given subsequence.
    • containsSubsequence

      public SELF containsSubsequence(Boolean[] subsequence)
      Verifies that the actual array contains the given subsequence (possibly with other values between them).

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).containsSubsequence(new Boolean[] { true, false });
       assertThat(new boolean[] { true, false, false, true }).containsSubsequence(new Boolean[] { true, true });
      
       // assertion will fail
       assertThat(new boolean[] { true, true, false }).containsSubsequence(new Boolean[] { false, true });
      Parameters:
      subsequence - the subsequence of values to look for.
      Returns:
      myself assertion object.
      Throws:
      AssertionError - if the actual array is null.
      AssertionError - if the given array is null.
      AssertionError - if the actual array does not contain the given subsequence.
    • contains

      public SELF contains(boolean value, Index index)
      Verifies that the actual array contains the given value at the given index.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).contains(true, atIndex(O));
       assertThat(new boolean[] { true, false }).contains(false, atIndex(1));
      
       // assertion will fail
       assertThat(new boolean[] { true, false }).contains(false, atIndex(0));
       assertThat(new boolean[] { true, false }).contains(true, atIndex(1));
      Parameters:
      value - the value to look for.
      index - the index where the value should be stored in the actual array.
      Returns:
      myself assertion object.
      Throws:
      AssertionError - if the actual array is null or empty.
      NullPointerException - if the given Index is null.
      IndexOutOfBoundsException - if the value of the given Index is equal to or greater than the size of the actual array.
      AssertionError - if the actual array does not contain the given value at the given index.
    • doesNotContain

      public SELF doesNotContain(boolean... values)
      Verifies that the actual array does not contain the given values.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, true }).doesNotContain(false);
      
       // assertion will fail
       assertThat(new boolean[] { true, true, false }).doesNotContain(false);
      Parameters:
      values - the given values.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      IllegalArgumentException - if the given argument is an empty array.
      AssertionError - if the actual array is null.
      AssertionError - if the actual array contains any of the given values.
    • doesNotContain

      public SELF doesNotContain(Boolean[] values)
      Verifies that the actual array does not contain the values of the given array.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, true }).doesNotContain(new Boolean[] { false });
      
       // assertion will fail
       assertThat(new boolean[] { true, true, false }).doesNotContain(new Boolean[] { false });
      Parameters:
      values - the given values.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      IllegalArgumentException - if the given argument is an empty array.
      AssertionError - if the actual array is null.
      AssertionError - if the actual array contains any of the given values.
    • doesNotContain

      public SELF doesNotContain(boolean value, Index index)
      Verifies that the actual array does not contain the given value at the given index.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).doesNotContain(true, atIndex(1));
       assertThat(new boolean[] { true, false }).doesNotContain(false, atIndex(0));
      
       // assertion will fail
       assertThat(new boolean[] { true, false }).doesNotContain(false, atIndex(1));
       assertThat(new boolean[] { true, false }).doesNotContain(true, atIndex(0));
      Parameters:
      value - the value to look for.
      index - the index where the value should be stored in the actual array.
      Returns:
      myself assertion object.
      Throws:
      AssertionError - if the actual array is null.
      NullPointerException - if the given Index is null.
      AssertionError - if the actual array contains the given value at the given index.
    • doesNotHaveDuplicates

      public SELF doesNotHaveDuplicates()
      Verifies that the actual array does not contain duplicates.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false }).doesNotHaveDuplicates();
      
       // assertion will fail
       assertThat(new boolean[] { true, true, false }).doesNotHaveDuplicates();
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual array is null.
      AssertionError - if the actual array contains duplicates.
    • startsWith

      public SELF startsWith(boolean... sequence)
      Verifies that the actual array starts with the given sequence of values, without any other values between them. Similar to containsSequence(boolean...), but it also verifies that the first element in the sequence is also first element of the actual array.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false, false, true }).startsWith(true, false);
      
       // assertion will fail
       assertThat(new boolean[] { true, false, false, true }).startsWith(false, false, true);
      Parameters:
      sequence - the sequence of values to look for.
      Returns:
      myself assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      IllegalArgumentException - if the given argument is an empty array.
      AssertionError - if the actual array is null.
      AssertionError - if the actual array does not start with the given sequence.
    • startsWith

      public SELF startsWith(Boolean[] sequence)
      Verifies that the actual array starts with the given sequence of values, without any other values between them. Similar to containsSequence(boolean...), but it also verifies that the first element in the sequence is also first element of the actual array.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false, false, true }).startsWith(new Boolean[] { true, false });
      
       // assertion will fail
       assertThat(new boolean[] { true, false, false, true }).startsWith(new Boolean[] { false, false, true });
      Parameters:
      sequence - the sequence of values to look for.
      Returns:
      myself assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      IllegalArgumentException - if the given argument is an empty array.
      AssertionError - if the actual array is null.
      AssertionError - if the actual array does not start with the given sequence.
    • endsWith

      public SELF endsWith(boolean... sequence)
      Verifies that the actual array ends with the given sequence of values, without any other values between them. Similar to containsSequence(boolean...), but it also verifies that the last element in the sequence is also last element of the actual array.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false, false, true }).endsWith(false, false, true);
      
       // assertion will fail
       assertThat(new boolean[] { true, false, false, true }).endsWith(true, false);
      Parameters:
      sequence - the sequence of values to look for.
      Returns:
      myself assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      IllegalArgumentException - if the given argument is an empty array.
      AssertionError - if the actual array is null.
      AssertionError - if the actual array does not end with the given sequence.
    • endsWith

      public SELF endsWith(Boolean[] sequence)
      Verifies that the actual array ends with the given sequence of values, without any other values between them. Similar to containsSequence(boolean...), but it also verifies that the last element in the sequence is also last element of the actual array.

      Example:

       // assertion will pass
       assertThat(new boolean[] { true, false, false, true }).endsWith(new Boolean[] { false, false, true });
      
       // assertion will fail
       assertThat(new boolean[] { true, false, false, true }).endsWith(new Boolean[] { true, false });
      Parameters:
      sequence - the sequence of values to look for.
      Returns:
      myself assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      IllegalArgumentException - if the given argument is an empty array.
      AssertionError - if the actual array is null.
      AssertionError - if the actual array does not end with the given sequence.
    • isSorted

      public SELF isSorted()
      Verifies that the actual array is sorted in ascending order according to the natural ordering of its elements.

      All array elements must be primitive or implement the Comparable interface and must be mutually comparable (that is, e1.compareTo(e2) must not throw a ClassCastException for any elements e1 and e2 in the array), examples :

      • a array composed of {2, 4, 6} is ok because the element type is a primitive type.
      • a array composed of {"a1", "a2", "a3"} is ok because the element type (String) is Comparable
      • a array composed of Rectangle {r1, r2, r3} is NOT ok because Rectangle is not Comparable
      • a array composed of {True, "abc", False} is NOT ok because elements are not mutually comparable (even though each element type implements Comparable)
      Empty or one element arrays are considered sorted (unless the array element type is not Comparable).

      Returns:
      this assertion object.
    • isSortedAccordingTo

      public SELF isSortedAccordingTo(Comparator<? super Boolean> comparator)
      Verifies that the actual array is sorted according to the given comparator.
      Empty arrays are considered sorted whatever the comparator is.
      One element arrays are considered sorted if the element is compatible with comparator, otherwise an AssertionError is thrown.
      Parameters:
      comparator - the Comparator used to compare array elements
      Returns:
      this assertion object.
    • usingElementComparator

      @Deprecated public final SELF usingElementComparator(Comparator<? super Boolean> customComparator)
      Deprecated.
      Custom element Comparator is not supported for Boolean array comparison.
      Do not use this method.
      Parameters:
      customComparator - the comparator to use for incoming assertion checks.
      Returns:
      this assertion object.
      Throws:
      UnsupportedOperationException - if this method is called.
    • usingDefaultElementComparator

      @Deprecated public final SELF usingDefaultElementComparator()
      Deprecated.
      Custom element Comparator is not supported for Boolean array comparison.
      Do not use this method.
      Returns:
      this assertion object.
      Throws:
      UnsupportedOperationException - if this method is called.
    • containsExactly

      public SELF containsExactly(boolean... values)
      Verifies that the actual group contains only the given values and nothing else, in order.

      Example :

       // assertion will pass
       assertThat(new boolean[] { true, false, true }).containsExactly(true, false, true);
      
       // assertion will fail as actual and expected order differ
       assertThat(new boolean[] { true, false, true }).containsExactly(false, true, true);
      Parameters:
      values - the given values.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      AssertionError - if the actual group is null.
      AssertionError - if the actual group does not contain the given values with same order, i.e. the actual group contains some or none of the given values, or the actual group contains more values than the given ones or values are the same but the order is not.
    • containsExactly

      public SELF containsExactly(Boolean[] values)
      Verifies that the actual group contains only the values of the given array and nothing else, in order.

      Example :

       // assertion will pass
       assertThat(new boolean[] { true, false, true }).containsExactly(new Boolean[] { true, false, true });
      
       // assertion will fail as actual and expected order differ
       assertThat(new boolean[] { true, false, true }).containsExactly(new Boolean[] { false, true, true });
      Parameters:
      values - the given values.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      AssertionError - if the actual group is null.
      AssertionError - if the actual group does not contain the given values with same order, i.e. the actual group contains some or none of the given values, or the actual group contains more values than the given ones or values are the same but the order is not.
      Since:
      3.19.0
    • containsExactlyInAnyOrder

      public SELF containsExactlyInAnyOrder(boolean... values)
      Verifies that the actual group contains exactly the given values and nothing else, in any order.

      Example :

       // assertions will pass
       assertThat(new boolean[] { true, false }).containsExactlyInAnyOrder(false, true);
       assertThat(new boolean[] { true, false, true }).containsExactlyInAnyOrder(true, true, false);
      
       // assertions will fail
       assertThat(new boolean[] { true, false }).containsExactlyInAnyOrder(true);
       assertThat(new boolean[] { true }).containsExactlyInAnyOrder(false, true);
       assertThat(new boolean[] { true, true, false }).containsExactlyInAnyOrder(false, true);
      Parameters:
      values - the given values.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      AssertionError - if the actual group is null.
      AssertionError - if the actual group does not contain the given values, i.e. the actual group contains some or none of the given values, or the actual group contains more values than the given ones.
      Since:
      2.6.0 / 3.6.0
    • containsExactlyInAnyOrder

      public SELF containsExactlyInAnyOrder(Boolean[] values)
      Verifies that the actual group contains exactly the values of the given array and nothing else, in any order.

      Example :

       // assertions will pass
       assertThat(new boolean[] { true, false }).containsExactlyInAnyOrder(new Boolean[] { false, true });
       assertThat(new boolean[] { true, false, true }).containsExactlyInAnyOrder(new Boolean[] { true, true, false });
      
       // assertions will fail
       assertThat(new boolean[] { true, false }).containsExactlyInAnyOrder(new Boolean[] { true });
       assertThat(new boolean[] { true }).containsExactlyInAnyOrder(new Boolean[] { false, true });
       assertThat(new boolean[] { true, true, false }).containsExactlyInAnyOrder(new Boolean[] { false, true });
      Parameters:
      values - the given values.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the given argument is null.
      AssertionError - if the actual group is null.
      AssertionError - if the actual group does not contain the given values, i.e. the actual group contains some or none of the given values, or the actual group contains more values than the given ones.
      Since:
      3.19.0
    • containsAnyOf

      public SELF containsAnyOf(boolean... values)
      Verifies that the actual array contains at least one of the given values.

      Example :

       boolean[] soTrue = { true, true, true };
      
       // assertions will pass
       assertThat(soTrue).containsAnyOf(true)
                         .containsAnyOf(false, false, false, true);
      
       // assertions will fail
       assertThat(oneTwoThree).containsAnyOf(false);
       assertThat(oneTwoThree).containsAnyOf(false, false, false);
      Parameters:
      values - the values whose at least one which is expected to be in the array under test.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the array of values is null.
      IllegalArgumentException - if the array of values is empty and the array under test is not empty.
      AssertionError - if the array under test is null.
      AssertionError - if the array under test does not contain any of the given values.
      Since:
      2.9.0 / 3.9.0
    • containsAnyOf

      public SELF containsAnyOf(Boolean[] values)
      Verifies that the actual array contains at least one of the values of the given array.

      Example :

       boolean[] soTrue = { true, true, true };
      
       // assertions will pass
       assertThat(soTrue).containsAnyOf(new Boolean[] { true })
                         .containsAnyOf(new Boolean[] { false, false, false, true });
      
       // assertions will fail
       assertThat(oneTwoThree).containsAnyOf(new Boolean[] { false });
       assertThat(oneTwoThree).containsAnyOf(new Boolean[] { false, false, false });
      Parameters:
      values - the values whose at least one which is expected to be in the array under test.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if the array of values is null.
      IllegalArgumentException - if the array of values is empty and the array under test is not empty.
      AssertionError - if the array under test is null.
      AssertionError - if the array under test does not contain any of the given values.
      Since:
      3.19.0