protected Set<String> getContentTypes(String contentType) {
        if (StringUtils.isNullOrEmpty(contentType)) {
            return Collections.emptySet();
        }

        Set<String> set = new LinkedHashSet<>();
        String[] types = contentType.split(",");
        for (String type : types) {
            if (type.contains(";")) {
                // drop ;q=0.8 quality scores
                type = type.substring(0, type.indexOf(';'));
            }

            set.add(type.trim().toLowerCase());
        }

        return set;
    }
protected Set < String > getContentTypes ( String contentType ) { if ( StringUtils . isNullOrEmpty ( contentType ) ) { return Collections . emptySet ( ) ; } Set < String > set = new LinkedHashSet < > ( ) ; String [ ] types = contentType . split ( "," ) ; for ( String type : types ) { if ( type . contains ( ";" ) ) { type = type . substring ( 0 , type . indexOf ( ';' ) ) ; } set . add ( type . trim ( ) . toLowerCase ( ) ) ; } return set ; }
Cleans a complex content-type or accept header value by removing the
quality scores.
<p/>
<pre>
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp
</pre>

@param contentType
@return the sanitized set of content-types