public static <X extends RuntimeException> String validateAndNormaliseCompression(
            final AttributeMap attributeMap,
            final Function<String, ? extends X> exceptionFunction) {

        Objects.requireNonNull(attributeMap, "attributeMap not supplied");
        final String key = StandardHeaderArguments.COMPRESSION;
        String compression = attributeMap.get(key);
        if (NullSafe.isNonEmptyString(compression)) {
            if (!StandardHeaderArguments.VALID_COMPRESSION_SET.contains(compression)) {
                // Try to normalise it
                // AttributeMap values are already trimmed
                compression = compression.toUpperCase(StreamUtil.DEFAULT_LOCALE);
                // Put the normalised value back in the map
                attributeMap.put(key, compression);
            }

            // Now check again
            if (!StandardHeaderArguments.VALID_COMPRESSION_SET.contains(compression)) {
                Objects.requireNonNull(exceptionFunction, "no exceptionSupplier provided");
                throw exceptionFunction.apply(attributeMap.get(key));
            }
        }
        return compression;
    }
@param exceptionFunction Called if the normalised value is not valid.
                         The compression value is passed into exceptionSupplier.
@return The normalised value, if valid, or null if the entry is not present in the
{@link AttributeMap}
stroom-meta/stroom-meta-api/src/main/java/stroom/meta/api/AttributeMapUtil.java