public static function getExtensions(array $mimesTypes, $asUpperCase = false)
    {
        if (empty($mimesTypes)) {
            return [];
        }

        $extensions = [];

        foreach ($mimesTypes as $mimeType) {
            $extension = self::getExtension($mimeType);

            /*
             * No extension for given mime type?
             * Nothing to do
             */
            if (empty($extension)) {
                continue;
            }

            if ($asUpperCase) {
                if (is_array($extension)) {
                    array_walk($extension, function (&$value) {
                        $value = strtoupper($value);
                    });
                } else {
                    $extension = strtoupper($extension);
                }
            }

            $extensions[$mimeType] = $extension;
        }

        return $extensions;
    }