net.derquinse.common.test
Class EqualityTests

java.lang.Object
  extended by net.derquinse.common.test.EqualityTests

public final class EqualityTests
extends Object

Equality tests support methods.

Author:
Andres Rodriguez

Method Summary
static void many(List<?> objects)
          Checks equality for many object.
static void many(Object... objects)
          Checks equality for many object.
static void one(Object obj)
          Checks equality for one object.
static void two(Object obj1, Object obj2)
          Checks equality for two objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

one

public static void one(Object obj)
Checks equality for one object. The object must be not null, equal to itself (the relation is reflexive), not equal to null.

Parameters:
obj - Object to test.

two

public static void two(Object obj1,
                       Object obj2)
Checks equality for two objects. The objects are checked for single object equality (@see #one(Object)} that their hash codes are the same (the relation is symmetric).

Parameters:
obj1 - First object to test.
obj1 - Second object to test.

many

public static void many(@Nullable
                        List<?> objects)
Checks equality for many object. The objects are tested pairwise (see two(Object, Object)), so that the relation is transitive.

Parameters:
objects - Objects to test.

many

public static void many(Object... objects)
Checks equality for many object. The objects are tested pairwise (see two(Object, Object)), so that the relation is transitive.

Parameters:
objects - Objects to test.


Copyright © 2012. All Rights Reserved.