StreamServiceKey implements Serializable { public static StreamServiceKey create( String dataServiceId, Map<String, String> parameters, List<OptimizationImpactInfo> optimizationList ) { Map<String, String> params = Collections.unmodifiableMap( new HashMap<>( parameters ) ); List<String> optimizations = new ArrayList<>(); if ( optimizationList != null ) { for ( OptimizationImpactInfo optimizationImpact : optimizationList ) { if ( optimizationImpact.getQueryAfterOptimization() != null && !optimizationImpact.getQueryAfterOptimization().isEmpty() ) { optimizations.add( optimizationImpact.getQueryAfterOptimization() ); } } } return new StreamServiceKey( dataServiceId, params, optimizations ); } private  StreamServiceKey( String dataServiceId, Map<String, String> parameters, List<String> optimizations ); static StreamServiceKey create( String dataServiceId, Map<String, String> parameters, List<OptimizationImpactInfo> optimizationList ); String getDataServiceId(); Map<String, String> getParameters(); List<String> getOptimizations(); @Override boolean equals( Object o ); @Override int hashCode(); @Override String toString();  }
@Test public void testCreate() { StreamServiceKey key = StreamServiceKey.create( mockDataServiceId, mockParameters, mockOptimizationList ); assertNotNull( key ); assertEquals( mockDataServiceId, key.getDataServiceId() ); assertEquals( mockParameters, key.getParameters() ); assertNotSame( mockParameters, key.getParameters() ); assertEquals( 1, key.getOptimizations().size() ); assertEquals( queryAfterOptimization, key.getOptimizations().get( 0 ) ); }