Class CollectionAssert


  • public final class CollectionAssert
    extends Object
    Assertions for collections.
    Since:
    0.5.0
    Version:
    $Id$
    Author:
    tlerios@marketcetera.com
    • Constructor Detail

      • CollectionAssert

        private CollectionAssert()
        Constructor. It is private so that no instances can be created.
    • Method Detail

      • assertArrayPermutation

        public static <T> void assertArrayPermutation​(String message,
                                                      T[] expected,
                                                      T[] actual)
        Asserts that the two given arrays are permutations of each other. This assertion holds if both arrays are null, or if they have one or more (but an equal number of) null elements. If the assertion does not hold, the AssertionError thrown starts with the given message, which may be null if no such custom message prefix is desired.
        Type Parameters:
        T - a T value
        Parameters:
        message - The identifying message.
        expected - The expected array.
        actual - The actual array.
      • assertArrayPermutation

        public static <T> void assertArrayPermutation​(T[] expected,
                                                      T[] actual)
        Asserts that the two given arrays are permutations of each other. This assertion holds if both arrays are null, or if they have one or more (but an equal number of) null elements.
        Type Parameters:
        T - a T value
        Parameters:
        expected - The expected array.
        actual - The actual array.