Here you can find the source of objectsEqual(Object o1, Object o2)
public static boolean objectsEqual(Object o1, Object o2)
//package com.java2s; //License from project: Open Source License public class Main { /** Simple null-safe equality check */ public static boolean objectsEqual(Object o1, Object o2) { return o1 == null ? o2 == null : o1.equals(o2); }//from w w w .j a v a2 s. c om }