private static Map<SystemStream, SystemStreamMetadata> getMetadata(Set<SystemStream> streamsToMonitor,
      StreamMetadataCache metadataCache) {
    return JavaConverters
        .mapAsJavaMapConverter(
            metadataCache.getStreamMetadata(
                JavaConverters.asScalaSetConverter(streamsToMonitor).asScala().toSet(),
                true
            )
        ).asJava();
  }
Gets the metadata for all the specified system streams from the provided metadata cache.
Handles scala-java conversions.

@param streamsToMonitor  the set of system streams for which the metadata is needed.
@param metadataCache     the metadata cache which will be used to fetch metadata.
@return                  a map from each system stream to its metadata.
samza-core/src/main/java/org/apache/samza/coordinator/StreamPartitionCountMonitor.java