Here you can find the source of assertEqual(Object obj1, Object obj2)
Parameter | Description |
---|---|
obj1 | Object |
obj2 | Object |
public final static void assertEqual(Object obj1, Object obj2)
//package com.java2s; //License from project: Open Source License public class Main { /**/*w ww . j av a 2s . c o m*/ * Method assertEqual. * * @param obj1 * Object * @param obj2 * Object */ public final static void assertEqual(Object obj1, Object obj2) { 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); } } }