public void replaceValues ( String key , Object value ) { // fields.replaceValues(key, Collections.singletonList(value)); // unnecessarily slow List < Object > list = fields . get ( key ) ; list . clear ( ) ; list . add ( value ) ; }
Removes all values that are associated with the given key and then associates the given value with the given key .