I need a Map but when I call get(key, n) it should should return not only all the records with the searched key value, but also all where the n last significant bits of the key are the same as the search key (e.g. applying something like key&(1<<(n+1)-1)).
Is there something like this already implemented in Java?