@Override
            public int hashCode() {
                int result = (int) (offset ^ (offset >>> 32));
                result = 31 * result + (int) (producerId ^ (producerId >>> 32));
                result = 31 * result + (int) producerEpoch;
                result = 31 * result + (record != null ? record.hashCode() : 0);
                return result;
            }
A simple Coordinator implementation that stores the records into a set.
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/runtime/CoordinatorRuntimeTest.java