Here you can find the source of areEqual(Object first, Object second, boolean equalEvenIfBothNull)
public static boolean areEqual(Object first, Object second, boolean equalEvenIfBothNull)
//package com.java2s; //License from project: Apache License public class Main { public static boolean areEqual(Object first, Object second, boolean equalEvenIfBothNull) { return (equalEvenIfBothNull ? areEqualEvenIfBothNull(first, second) : areEqual(first, second)); }//from ww w .ja v a 2 s .c o m private static boolean areEqual(Object first, Object second) { return (first != null && second != null && first.equals(second)); } private static boolean areEqualEvenIfBothNull(Object first, Object second) { return ((first == null && second == null) || (first != null && second != null && first.equals(second))); } }