combine two LinkedHashMap<>() to one Map

1.1k Views Asked by At

I am trying to Combine two Map timeMap1 has size 17 and timeMap2 has size 18 in timeMap. After combination timeMap has just 23 entries. How can I fix that?

Simple key with value:

apple 
[06:15, 06:45, 07:16, 07:46]

I want to combine then to get this result from the entry:

   apple 06:15 06:45 07:16 07:46

Code:

                Map<String, List<String>> timeMap = new LinkedHashMap<>();
                Map<String, List<String>> timeMap1   =  merge_table(timeListFirst);
                timeMap.putAll(timeMap1);
                Map<String, List<String>> timeMap2 =    merge_table(timeListSecond);
                timeMap.putAll(timeMap2);
0

There are 0 best solutions below