public static synchronized void registerStream(Stream stream){
  if (STREAMS.containsKey(stream.getName())) {
    throw new IllegalArgumentException("Can't register stream with name [" + stream.getName() + "] more than once");
  }
  HashMap<String,Stream> map=new HashMap<>();
  map.putAll(STREAMS);
  map.put(stream.getName(),stream);
  STREAMS=Collections.unmodifiableMap(map);
}

public static synchronized void registerStream ( Stream stream ) { if ( STREAMS . containsKey ( stream . getName ( ) ) ) { throw new IllegalArgumentException ( "Can't register stream with name [" + stream . getName ( ) + "] more than once" ) ; } HashMap < String , Stream > map = new HashMap < > ( ) ; map . putAll ( STREAMS ) ; map . put ( stream . getName ( ) , stream ) ; STREAMS = Collections . unmodifiableMap ( map ) ; }
registers the given stream and associate it with the given types .
