The list of methods to do Assert Equal are organized into topic(s).
boolean
assertCharacterArraysEqual(char[] first, char[] second) Asserts that the specified first array of characters is identical to the specified second array of characters.
int firstLength = first.length;
int secondLength = second.length;
if (firstLength != secondLength) {
return false;
for (int index = 0; index < firstLength; index++) {
char firstCharacter = first[index];
char secondCharacter = second[index];
...
void
assertDatesEqual(Calendar first, Calendar second) assert Dates Equal
if (first == null && second != null) {
throw new AssertionError("dates are not equal. first is null, second is not");
} else if (first != null && second == null) {
throw new AssertionError("dates are not equal. second is null, first is not");
boolean yearsNotEqual = first.get(Calendar.YEAR) != second.get(Calendar.YEAR);
boolean monthsNotEqual = first.get(Calendar.MONTH) != second.get(Calendar.MONTH);
boolean daysNotEqual = first.get(Calendar.DAY_OF_MONTH) != second.get(Calendar.DAY_OF_MONTH);
...
void
assertEqual(Object obj1, Object obj2) Method assertEqual.
if (obj1 == null || obj2 == null) {
throw new RuntimeException("assertion: " + obj1 + " must be equal to " + obj2);
if (obj1 != null && !obj1.equals(obj2)) {
throw new RuntimeException("assertion: " + obj1 + " must be equal to " + obj2);
if (obj2 != null && !obj2.equals(obj1)) {
throw new RuntimeException("assertion: " + obj1 + " must be equal to " + obj2);
...
void
assertEquality(Object original, Object equal, Object... notEqual) assert Equality
if (!original.equals(equal)) {
throw new AssertionError("Objects where not equal " + original + " != " + equal);
if (original.hashCode() != equal.hashCode()) {
throw new AssertionError("Equal objects did not have same hash :" + original + "(" + original.hashCode()
+ ")" + " " + equal + "(" + equal.hashCode() + ")");
for (Object notEqualObject : notEqual) {
...