StreamServiceKey implements Serializable { @Override public String toString() { return Objects.toStringHelper( StreamServiceKey.class ) .add( "dataServiceId", dataServiceId ) .add( "parameters", parameters ) .add( "optimizations", optimizations ) .toString(); } 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 testToString() { StreamServiceKey key = StreamServiceKey.create( mockDataServiceId, mockParameters, mockOptimizationList ); String toStringTest = "StreamServiceKey{dataServiceId=" + mockDataServiceId + ", parameters=" + mockParameters.toString() + ", optimizations=[" + queryAfterOptimization + "]}"; assertEquals( toStringTest, key.toString() ); mockParameters.put( "Test", "Test" ); toStringTest = "StreamServiceKey{dataServiceId=" + mockDataServiceId + ", parameters=" + mockParameters.toString() + ", optimizations=[" + queryAfterOptimization + "]}"; key = StreamServiceKey.create( mockDataServiceId, mockParameters, mockOptimizationList ); assertEquals( toStringTest, key.toString() ); }