Here you can find the source of assertEquals(Object obj1, Object obj2, String errMsg)
public static void assertEquals(Object obj1, Object obj2, String errMsg)
//package com.java2s; public class Main { public static void assertEquals(Object obj1, Object obj2, String errMsg) { if (obj1 == null) { assertNull(obj2, errMsg);//from w w w. ja v a 2 s . co m return; } if (!obj1.equals(obj2)) { throw new RuntimeException(errMsg); } } public static void assertNull(Object object, String errMsg) { if (object != null) { throw new RuntimeException(errMsg); } } }