public static void mergeIfAbsent ( Map < String , String > map , Map < String , String > toMerge ) { for ( Map . Entry < String , String > entry : toMerge . entrySet ( ) ) { putIfAbsent ( map , entry . getKey ( ) , entry . getValue ( ) ) ; ; } }
Add all values of a map to another map but onlfy if not already existing .