associate a new unique value with a specified key . under the covers , the method employs optimistic concurrency : if no set is associated with a given key , we create a new set ; if another thread comes in , creates , and associates a set with the same key in the mean-time , we simply add the value to the already created set . concode_field_sep ConcurrentMap<K,Set<V>> container concode_elem_sep Supplier<Set<V>> valueSetFactory concode_elem_sep Comparator<V> comparator concode_field_sep Set<V> values concode_elem_sep Set<V> get concode_elem_sep boolean remove
void function ( K arg0 , V arg1 ) { Set < V > loc0 = container . get ( arg0 ) ; if ( loc0 != null ) { loc0 . add ( arg1 ) ; } else { loc0 = valueSetFactory . get ( ) ; loc0 . add ( arg1 ) ; Set < V > loc1 = container . putIfAbsent ( arg0 , loc0 ) ; if ( loc1 != null ) { loc1 . add ( arg1 ) ; } } }