OffsetAndMetadata pendingTransactionalOffset(
        long producerId,
        String groupId,
        String topic,
        int partition
    ) {
        Offsets offsets = pendingTransactionalOffsets.get(producerId);
        if (offsets == null) return null;
        return offsets.get(groupId, topic, partition);
    }
@return The pending transactional offset for the provided parameters or null
if it does not exist.

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