public static Object[] trimmedCopy(final Object[] argArray) {
        if (argArray == null || argArray.length == 0) {
            throw new IllegalStateException("non-sensical empty or null argument array");
        }

        final int trimmedLen = argArray.length - 1;

        Object[] trimmed = new Object[trimmedLen];

        if (trimmedLen > 0) {
            System.arraycopy(argArray, 0, trimmed, 0, trimmedLen);
        }

        return trimmed;
    }
Helper method to get all but the last element of an array

@param argArray The arguments from which we want to remove the last element

@return a copy of the array without the last element
slf4j-api/src/main/java/org/slf4j/helpers/NormalizedParameters.java