public static boolean isSameType(Object array1, Object array2) {
        if (array1 == null || array2 == null) {
            throw new IllegalArgumentException("The Array must not be null");
        }
        return array1.getClass().getName().equals(array2.getClass().getName());
    }
<p>Checks whether two arrays are the same type taking into account
multi-dimensional arrays.</p>

@param array1 the first array, must not be {@code null}
@param array2 the second array, must not be {@code null}
@return {@code true} if type of arrays matches
@throws IllegalArgumentException if either array is {@code null}
android/android_framework/base/src/main/java/lang3/ArrayUtils.java