private boolean methodMatch(Method other) {
            // Note: was checked against the source code of Method.equals.
            if (method.getName().equals(other.getName())
              && method.getReturnType().equals(other.getReturnType())) {
                Class<?>[] methodParams = method.getParameterTypes();
                Class<?>[] otherParams = other.getParameterTypes();
                if (methodParams.length == otherParams.length) {
                    for (int index = 0; index < otherParams.length; index++) {
                        if (methodParams[index] != otherParams[index]) {
                            return false;
                        }
                    }

                    return true;
                } else {
                    return false;
                }
            } else {
                return false;
            }
        }