GeneratedEnumType implements Type { @Override public int hashCode() { int result = getTypeName().hashCode(); result = 31 * result + constants.hashCode(); return result; } GeneratedEnumType(String typeName, List<String> constants); List<String> getEnumConstants(); @Override String getTypeName(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test void testHashCode() { final List<String> otherConstants = new ArrayList<>(ENUM_CONSTANTS); otherConstants.add("Z"); final GeneratedEnumType other = new GeneratedEnumType(TYPE_NAME, otherConstants); assertNotEquals(other.hashCode(), instance.hashCode()); }