Map<String, SystemStreamMetadata> getSystemStreamMetadata(String systemName, Set<String> streamNames) {
    Map<String, Map<SystemStreamPartition, List<IncomingMessageEnvelope>>> result =
        bufferedMessages.entrySet()
            .stream()
            .filter(entry -> systemName.equals(entry.getKey().getSystem())
                && streamNames.contains(entry.getKey().getStream()))
            .collect(Collectors.groupingBy(entry -> entry.getKey().getStream(),
                Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));

    return result.entrySet()
        .stream()
        .collect(Collectors.toMap(Map.Entry::getKey,
          entry -> constructSystemStreamMetadata(entry.getKey(), entry.getValue())));
  }
Fetch system stream metadata for the given streams.

@param systemName system name
@param streamNames set of input streams

@return a {@link Map} of stream to {@link SystemStreamMetadata}
samza-core/src/main/java/org/apache/samza/system/inmemory/InMemoryManager.java