So I needed this again.
I have lots of pieces of data, which I need to categorize in two ways:
- Map of all actions involving the data.
- Map of all targets involving the same data.
Because I need to be able to quickly get answers to “which targets has this data been involved with” and “what actions has this data been involved with”, and if I could have the same data in two different maps this would be easy.
But turns out, it’s still not easy.
So, again, a stupid workaround is to choose to only answer the second question, and then save a Set of answers to the first question with every piece of data, and then every time you want to ask that second question, you have to iterate over all the data and all the Sets.