@ Override public V get ( Object key ) { if ( super . containsKey ( key ) ) { return super . get ( key ) ; } else { @ SuppressWarnings ( "unchecked" ) K k = ( K ) key ; V v = makeDefault . apply ( k ) ; put ( k , v ) ; return v ; } }
If the key isn t in the dictionary the makeDefault function will be called to create a new value which will be added