public static boolean equals(final Object[] what, final Object[] to) {
        /*
         * If they are the same reference or both null
         */
        if (what == to) {
            return true;
        }

        /*
         * Can we compare them?
         */
        if ((what == null) || (to == null)) {
            return false;
        }

        if (what.length == to.length) {
            /*
             * check all children
             */
            for (int i = 0; i < what.length; ++i) {
                final Object leftElem = what[i];
                final Object rightElem = to[i];
                if ((leftElem != null) && (rightElem != null)) {
                    if (!leftElem.equals(rightElem)) {
                        return false;
                    }
                } else {
                    if (leftElem != rightElem) {
                        return false;
                    }
                }
            }

            /*
             * All them are equal
             */
            return true;
        }

        /*
         * One of them is different. We were unable to compare them
         */
        return false;
    }