MarketConfig { @Override public int hashCode() { return Objects.hashCode(id); } MarketConfig();  MarketConfig(MarketConfig other);  MarketConfig(
      String id,
      String name,
      String baseCurrency,
      String counterCurrency,
      boolean enabled,
      String tradingStrategyId); String getId(); void setId(String id); String getName(); void setName(String name); String getBaseCurrency(); void setBaseCurrency(String baseCurrency); String getCounterCurrency(); void setCounterCurrency(String counterCurrency); boolean isEnabled(); void setEnabled(boolean enabled); String getTradingStrategyId(); void setTradingStrategyId(String tradingStrategyId); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testHashCodeWorksAsExpected() { final MarketConfig market1 = new MarketConfig(ID, NAME, BASE_CURRENCY, COUNTER_CURRENCY, IS_ENABLED, TRADING_STRATEGY); final MarketConfig market2 = new MarketConfig( "different-id", NAME, BASE_CURRENCY, COUNTER_CURRENCY, IS_ENABLED, TRADING_STRATEGY); final MarketConfig market3 = new MarketConfig( ID, "different-name", BASE_CURRENCY, COUNTER_CURRENCY, IS_ENABLED, TRADING_STRATEGY); assertEquals(market1.hashCode(), market1.hashCode()); assertNotEquals(market1.hashCode(), market2.hashCode()); assertEquals(market1.hashCode(), market3.hashCode()); }