Here you can find the source of areEqual(T obj1, V obj2)
public static <T, V> void areEqual(T obj1, V obj2)
//package com.java2s; /**//from www .ja v a 2 s. c om * Copyright 2010 ZTEsoft Inc. All Rights Reserved. * * This software is the proprietary information of ZTEsoft Inc. * Use is subject to license terms. * * $Tracker List * * $TaskId: $ $Date: 9:24:36 AM (May 9, 2008) $comments: create * $TaskId: $ $Date: 3:56:36 PM (SEP 13, 2010) $comments: upgrade jvm to jvm1.5 * * */ public class Main { public static <T, V> void areEqual(T obj1, V obj2, String msg) { if (!obj1.equals(obj2)) { throw new IllegalArgumentException(msg); } } public static <T, V> void areEqual(T obj1, V obj2) { areEqual(obj1, obj2, "The object is not equal."); } }