StreamServiceKey implements Serializable { @Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } StreamServiceKey cacheKey = (StreamServiceKey) o; return Objects.equal( dataServiceId, cacheKey.dataServiceId ) && Objects.equal( parameters, cacheKey.parameters ) && Objects.equal( optimizations, cacheKey.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 testEquals() { StreamServiceKey key = StreamServiceKey.create( mockDataServiceId, mockParameters, mockOptimizationList ); StreamServiceKey key2 = StreamServiceKey.create( mockOtherDataServiceId, mockOtherParameters, mockOptimizationList ); assertNotNull( key ); assertNotNull( key2 ); assertTrue( key.equals( key2 ) ); assertTrue( key2.equals( key ) ); mockParameters.put( "Test", "Test" ); key = StreamServiceKey.create( mockDataServiceId, mockParameters, mockOptimizationList ); assertFalse( key.equals( key2 ) ); assertFalse( key2.equals( key ) ); mockOtherParameters.put( "Test", "Test" ); key2 = StreamServiceKey.create( mockOtherDataServiceId, mockOtherParameters, mockOptimizationList ); assertTrue( key.equals( key2 ) ); assertTrue( key2.equals( key ) ); mockDataServiceId = mockDataServiceId + mockDataServiceId; key = StreamServiceKey.create( mockDataServiceId, mockParameters, mockOptimizationList ); assertFalse( key.equals( key2 ) ); assertFalse( key2.equals( key ) ); mockOtherDataServiceId = mockDataServiceId; key2 = StreamServiceKey.create( mockOtherDataServiceId, mockOtherParameters, mockOptimizationList ); assertTrue( key.equals( key2 ) ); assertTrue( key2.equals( key ) ); key2 = StreamServiceKey.create( mockOtherDataServiceId, mockOtherParameters, mockOtherOptimizationList ); assertFalse( key.equals( key2 ) ); assertFalse( key2.equals( key ) ); key = StreamServiceKey.create( mockDataServiceId, mockParameters, mockOtherOptimizationList ); assertTrue( key.equals( key2 ) ); assertTrue( key2.equals( key ) ); }