StreamServiceKey implements Serializable { @Override public int hashCode() { return Objects.hashCode( dataServiceId, parameters, 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 testHashCode() { StreamServiceKey key = StreamServiceKey.create( mockDataServiceId, mockParameters, mockOptimizationList ); List<String> optimizations = new ArrayList<>(); optimizations.add( queryAfterOptimization ); int hashCode = Objects.hashCode( mockDataServiceId, mockParameters, optimizations ); assertEquals( hashCode, key.hashCode() ); }