OffsetAndMetadata offset(
        String groupId,
        String topic,
        int partition
    ) {
        return offsets.get(groupId, topic, partition);
    }
@return The offset for the provided groupId and topic partition or null
if it does not exist.

package-private for testing.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/OffsetMetadataManager.java