private Map<SystemStream, Integer> getSystemStreamToPartitionCount(Map<TaskName, List<SystemStreamPartition>> taskToSSPAssignment) {
    Map<SystemStream, Integer> systemStreamToPartitionCount = new HashMap<>();
    taskToSSPAssignment.forEach((taskName, systemStreamPartitions) -> {
      systemStreamPartitions.forEach(systemStreamPartition -> {
        SystemStream systemStream = systemStreamPartition.getSystemStream();
        systemStreamToPartitionCount.put(systemStream, systemStreamToPartitionCount.getOrDefault(systemStream, 0) + 1);
      });
    });

    return systemStreamToPartitionCount;
  }
Computes a mapping from system stream to partition count using the provided {@param taskToSSPAssignment}.
@param taskToSSPAssignment the {@link TaskName} to {@link SystemStreamPartition}'s assignment of the job.
@return a mapping from {@link SystemStream} to the number of partitions of the stream.
samza-core/src/main/java/org/apache/samza/container/grouper/stream/SSPGrouperProxy.java