private OffsetAndMetadata remove(
            String groupId,
            String topic,
            int partition
        ) {
            TimelineHashMap<String, TimelineHashMap<Integer, OffsetAndMetadata>> topicOffsets = offsetsByGroup.get(groupId);
            if (topicOffsets == null)
                return null;

            TimelineHashMap<Integer, OffsetAndMetadata> partitionOffsets = topicOffsets.get(topic);
            if (partitionOffsets == null)
                return null;

            OffsetAndMetadata removedValue = partitionOffsets.remove(partition);

            if (partitionOffsets.isEmpty())
                topicOffsets.remove(topic);

            if (topicOffsets.isEmpty())
                offsetsByGroup.remove(groupId);

            return removedValue;
        }
The offsets keyed by group id, topic name and partition id.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/OffsetMetadataManager.java