Class MapTester


  • public class MapTester
    extends java.lang.Object
    This class asserts (among other things) that two maps are equals.
    Since:
    1.4 (18.12.2013)
    Author:
    oliver
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void assertEqualKeys​(java.util.Map<?,​?> m1, java.util.Map<?,​?> m2)
      Checks if each key in map m1 is equals to that of map m2.
      static void assertEquals​(java.util.Map<?,​?> m1, java.util.Map<?,​?> m2)
      Checks if each key-value pair in map m1 is equals to that of map m2.
      static void assertEqualValues​(java.util.Map<?,​?> m1, java.util.Map<?,​?> m2)
      Checks if each value in map m1 is equals to that of map m2.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • assertEquals

        public static void assertEquals​(java.util.Map<?,​?> m1,
                                        java.util.Map<?,​?> m2)
        Checks if each key-value pair in map m1 is equals to that of map m2. If not this method will tell you which pair is different. If the maps have different size this method will tell you which pair is missing.
        Parameters:
        m1 - the m1
        m2 - the m2
      • assertEqualKeys

        public static void assertEqualKeys​(java.util.Map<?,​?> m1,
                                           java.util.Map<?,​?> m2)
        Checks if each key in map m1 is equals to that of map m2. If not this method will tell you which key is different. If the maps have different size this method will tell you which key is missing.
        Parameters:
        m1 - the m1
        m2 - the m2
      • assertEqualValues

        public static void assertEqualValues​(java.util.Map<?,​?> m1,
                                             java.util.Map<?,​?> m2)
        Checks if each value in map m1 is equals to that of map m2. If not this method will tell you which map is different. If the maps have different size this method will tell you which value is missing.
        Parameters:
        m1 - the m1
        m2 - the m2