I have a method that receives List<String> keys
and does some computations on these and at the end it returns Map<String, String>
that has keys from that List and values computed or not. If value cannot be computed I want to have empty String
for that key.
The clearest way would be to create Map containing all the keys with default values (empty String in that case) at the start of computations and then replace computed values.
What would be the best way to do so? There is no proper initializer in Collections API I think.