If you want to search only tuples (k1, k2), I would suggest MultiKeyMap or, more likely, a wrapper object included in the standard Map . But if you want to search from both one and the other, it looks like the built-in SQL engine might be better.
EDIT: depending on your data size, whether you need (k1, k2, k3) a search, how many such structures you will need (the SQL mechanism is relatively heavy) you might be better off with Mayrbek Hadikov's answer to the Guava table.
source share