Here you can find the source of areEqual(Object o1, Object o2)
public static boolean areEqual(Object o1, Object o2)
//package com.java2s; /******************************************************************************* * Copyright (c) 2007, 2014 Bruno Medeiros and other Contributors. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from www . j a va2s . co m*/ * Bruno Medeiros - initial implementation *******************************************************************************/ public class Main { /** @return whether the two given objects are the same (including null) or equal. */ public static boolean areEqual(Object o1, Object o2) { return (o1 == o2) || (o1 != null && o2 != null && o1.equals(o2)); } }