Elegant API for implementing equals() and hashCode() in Java classes.