private static < K , V > ImmutableMap < K , V > createDelegate ( final Map < K , V > base , final Set < ? extends K > keys , final Function < K , V > augmentation ) { final ImmutableMap . Builder < K , V > builder = ImmutableMap . builder ( ) ; builder . putAll ( base ) ; keys . stream ( ) . filter ( key -> ! base . containsKey ( key ) ) . forEach ( key -> builder . put ( key , augmentation . apply ( key ) ) ) ; return builder . build ( ) ; }
Creates map delegate .