Here you can find the source of isEquals(Object object1, Object object2)
public static boolean isEquals(Object object1, Object object2)
//package com.java2s; //License from project: Apache License import java.util.Arrays; public class Main { public static boolean isEquals(Object object1, Object object2) { if (object1 == object2) { return true; }/*from w w w . j a va 2 s.c om*/ if (object1 == null || object2 == null) { return false; } if (!object1.getClass().equals(object2.getClass())) { return false; } if (object1 instanceof Object[]) { return Arrays.deepEquals((Object[]) object1, (Object[]) object2); } else if (object1 instanceof int[]) { return Arrays.equals((int[]) object1, (int[]) object2); } else if (object1 instanceof long[]) { return Arrays.equals((long[]) object1, (long[]) object2); } else if (object1 instanceof short[]) { return Arrays.equals((short[]) object1, (short[]) object2); } else if (object1 instanceof byte[]) { return Arrays.equals((byte[]) object1, (byte[]) object2); } else if (object1 instanceof double[]) { return Arrays.equals((double[]) object1, (double[]) object2); } else if (object1 instanceof float[]) { return Arrays.equals((float[]) object1, (float[]) object2); } else if (object1 instanceof char[]) { return Arrays.equals((char[]) object1, (char[]) object2); } else if (object1 instanceof boolean[]) { return Arrays.equals((boolean[]) object1, (boolean[]) object2); } else { return object1.equals(object2); } } }