MultivaluedMap<K, V>
implements Map<K,List<V>>
so
((Map<String,List<String>>)map).get("Accept-Encoding").size();
Now I see that you use non generic version (which is not a good idea):
Map tmp = map instanceof Map ? (Map) map : new HashMap();
// because you don't use generic you should get value as an Object instance
Object value = tmp.get("Accept-Encoding");
// by default we assume that there the value is not a List instance
int size = 0;
// for security we check that the value instance implements List interface
if (value instanceof List) {
// we check size of that list
size = ((List) value).size();
}
Short version (and without checking):
((List) ((Map) map).get("Accept-Encoding")).size();
You should see why using generic version is better than raw version.