public static Throwable getThrowableCandidate(final Object[] argArray) {
        if (argArray == null || argArray.length == 0) {
            return null;
        }

        final Object lastEntry = argArray[argArray.length - 1];
        if (lastEntry instanceof Throwable) {
            return (Throwable) lastEntry;
        }

        return null;
    }
Helper method to determine if an {@link Object} array contains a
{@link Throwable} as last element

@param argArray The arguments off which we want to know if it contains a
                {@link Throwable} as last element
@return if the last {@link Object} in argArray is a {@link Throwable} this
        method will return it, otherwise it returns null
slf4j-api/src/main/java/org/slf4j/helpers/NormalizedParameters.java