I think my question is similar to this one: How to implement a Map with multiple keys? but with an important difference. In that question (if my understanding of it is corre
Apache Commons Collections has MultiKey.
import org.apache.commons.collections4.keyvalue.MultiKey; Map myMap = new HashMap(); myMap.put(new MultiKey(key1, key2), value); myMap.get(new MultiKey(key1, key2));
It has the benefit of creating N-dimensional arrays from a Map.