public final void assertEqualResults(final Object expected, final Object[] actual) {
        if (actual == null) {
            throw new junit.framework.AssertionFailedError(
                    "The mapper function result is invalid (null). Expecting the element <"
                            + DebugUtil.toString(expected) + ">.");
        }
        if (actual.length < 1) {
            throw new junit.framework.AssertionFailedError(
                    "The function result is empty. Expecting the element <"
                            + DebugUtil.toString(expected) + ">.");
        }
        if (actual.length > 1) {
            throw new junit.framework.AssertionFailedError("The function result has many values <"
                    + ArrayUtil.toString(actual, ", ") + ">. Expecting the singleton element <"
                    + DebugUtil.toString(expected) + ">.");
        }

        final Object result = actual[0];
        if ((result == null) && (expected != null)) {
            throw new junit.framework.AssertionFailedError(
                    "The function returned one null value. Expecting the singleton element <"
                            + DebugUtil.toString(expected) + ">.");
        }
        if (result != null && !result.equals(expected)) {
            throw new junit.framework.AssertionFailedError("The function returned value <"
                    + DebugUtil.toString(result) + "> differs from the expected value <"
                    + DebugUtil.toString(expected) + ">.");
        }
    }