public static boolean isSameLength(char[] array1, char[] array2) {
        if ((array1 == null && array2 != null && array2.length > 0) ||
            (array2 == null && array1 != null && array1.length > 0) ||
            (array1 != null && array2 != null && array1.length != array2.length)) {
                return false;
        }
        return true;
    }
<p>Checks whether two arrays are the same length, treating
{@code null} arrays as length {@code 0}.</p>

@param array1 the first array, may be {@code null}
@param array2 the second array, may be {@code null}
@return {@code true} if length of arrays matches, treating
 {@code null} as an empty array
android/android_framework/base/src/main/java/lang3/ArrayUtils.java