public class EqualsHashCodeTestUtils
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static interface |
EqualsHashCodeTestUtils.CopyFunction<T> |
A function that makes a copy of its input argument
|
static interface |
EqualsHashCodeTestUtils.MutateFunction<T> |
A function that creates a copy of its input argument that is different from its
input in exactly one aspect (e.g.
|
Constructor | Description |
---|---|
EqualsHashCodeTestUtils() |
Modifier and Type | Method | Description |
---|---|---|
static <T> void |
checkEqualsAndHashCode(T original,
EqualsHashCodeTestUtils.CopyFunction<T> copyFunction) |
Perform common equality and hashCode checks on the input object
|
static <T> void |
checkEqualsAndHashCode(T original,
EqualsHashCodeTestUtils.CopyFunction<T> copyFunction,
EqualsHashCodeTestUtils.MutateFunction<T> mutationFunction) |
Perform common equality and hashCode checks on the input object
|
public static <T> void checkEqualsAndHashCode(T original, EqualsHashCodeTestUtils.CopyFunction<T> copyFunction)
original
- the object under testcopyFunction
- a function that creates a deep copy of the input objectpublic static <T> void checkEqualsAndHashCode(T original, EqualsHashCodeTestUtils.CopyFunction<T> copyFunction, EqualsHashCodeTestUtils.MutateFunction<T> mutationFunction)
original
- the object under testcopyFunction
- a function that creates a deep copy of the input objectmutationFunction
- a function that creates a copy of the input object that is different
from the input in one aspect. The output of this call is used to check that it is not equal()
to the input object