You can use one card with two keys:
Map<Object, Person> personMap = new HashMap<Object, Person>() Person person = ... personMap.put(person.getName(), person) personMap.put(person.getSSN(), person)
Then you can get the key. This, of course, assumes that there are no conflicts in your key usage. If your two keys have different class types, this is safe. If your keys are of the same type ( String example), you may not want to use two card solutions.
Follow-up actions: This approach does suffer from type safety loss, but it only affects put(K, V) and putAll(Map<? extends K, ? extends V>) , since get(Object) and containsKey(Object) always accept an object.
So, with this restriction, I would wrap this single card or move with two card solutions (also wrapped).
source share