I just stumbled on one of Tony Morris\' blog-posts about Java and a fundamental problem with the language: that of defining a bespoke equality-relation for a collection. Thi
You're describing the concept of a hashing strategy. The Trove library includes sets and maps that can be constructed with hashing strategies.