@Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof OffsetAndTimestampInternal)) return false;

        OffsetAndTimestampInternal that = (OffsetAndTimestampInternal) o;

        if (timestamp != that.timestamp) return false;
        if (offset != that.offset) return false;
        return leaderEpoch.equals(that.leaderEpoch);
    }
Internal representation of {@link OffsetAndTimestamp} to allow negative timestamps and offset.
clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetAndTimestampInternal.java