I have a list of strings and I have a function to generate a value for each key in the list.
I want to create a map using this function. Can I do this with Google collec
Either I have misunderstood you or the other posters have. I understand that you want your list to be the map keys, while Maps.uniqueIndex() creates keys to map to your values (which is quite the opposite).
Anyway, there is an open Guava issue that requests the exact functionality you are requesting, and I have also implemented such a solution for a previous question.