@Test public void testHashCodeWorksAsExpected() { final StrategyConfig strategy1 = new StrategyConfig(ID, LABEL, DESCRIPTION, CLASSNAME, BEAN_NAME, CONFIG_ITEMS); final StrategyConfig strategy2 = new StrategyConfig("different-id", LABEL, DESCRIPTION, CLASSNAME, BEAN_NAME, CONFIG_ITEMS); final StrategyConfig strategy3 = new StrategyConfig(ID, "different-label", DESCRIPTION, CLASSNAME, BEAN_NAME, CONFIG_ITEMS); assertEquals(strategy1.hashCode(), strategy1.hashCode()); assertNotEquals(strategy1.hashCode(), strategy2.hashCode()); assertEquals(strategy1.hashCode(), strategy3.hashCode()); }
@Override public int hashCode() { return Objects.hashCode(id); }
StrategyConfig { @Override public int hashCode() { return Objects.hashCode(id); } }
StrategyConfig { @Override public int hashCode() { return Objects.hashCode(id); } StrategyConfig();  StrategyConfig(StrategyConfig other);  StrategyConfig(
      String id,
      String name,
      String description,
      String className,
      String beanName,
      Map<String, String> configItems); }
StrategyConfig { @Override public int hashCode() { return Objects.hashCode(id); } StrategyConfig();  StrategyConfig(StrategyConfig other);  StrategyConfig(
      String id,
      String name,
      String description,
      String className,
      String beanName,
      Map<String, String> configItems); String getId(); void setId(String id); String getName(); void setName(String name); String getDescription(); void setDescription(String description); String getClassName(); void setClassName(String className); String getBeanName(); void setBeanName(String beanName); Map<String, String> getConfigItems(); void setConfigItems(Map<String, String> configItems); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
StrategyConfig { @Override public int hashCode() { return Objects.hashCode(id); } StrategyConfig();  StrategyConfig(StrategyConfig other);  StrategyConfig(
      String id,
      String name,
      String description,
      String className,
      String beanName,
      Map<String, String> configItems); String getId(); void setId(String id); String getName(); void setName(String name); String getDescription(); void setDescription(String description); String getClassName(); void setClassName(String className); String getBeanName(); void setBeanName(String beanName); Map<String, String> getConfigItems(); void setConfigItems(Map<String, String> configItems); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }