DeclaredType implements InferredType { @Override public int hashCode() { return Objects.hash(typeClass.name(), typeClass.fullyQualifiedName(), typeArgs); } DeclaredType(Symbol typeClass, List<DeclaredType> typeArgs);   DeclaredType(Symbol typeClass); @Override boolean canHaveMember(String memberName); @Override boolean declaresMember(String memberName); @Override boolean isIdentityComparableWith(InferredType other); @Override Optional<Symbol> resolveMember(String memberName); @Override Optional<Symbol> resolveDeclaredMember(String memberName); @Override boolean canBeOrExtend(String typeName); @Override boolean canOnlyBe(String typeName); @Override boolean isCompatibleWith(InferredType other); @Override boolean mustBeOrExtend(String typeName); @Override String toString(); String typeName(); Set<Symbol> alternativeTypeSymbols(); @Override boolean equals(Object o); @Override int hashCode(); static InferredType fromInferredType(InferredType inferredType);  }
@Test public void test_hashCode() { DeclaredType aType = new DeclaredType(a); assertThat(aType.hashCode()).isEqualTo(new DeclaredType(a).hashCode()); assertThat(aType.hashCode()).isNotEqualTo(new DeclaredType(b).hashCode()); assertThat(aType.hashCode()).isNotEqualTo(new DeclaredType(a, Arrays.asList(new DeclaredType(b), new DeclaredType(c))).hashCode()); DeclaredType x = new DeclaredType(new ClassSymbolImpl("X", null)); DeclaredType y = new DeclaredType(new ClassSymbolImpl("Y", null)); assertThat(x.hashCode()).isNotEqualTo(y.hashCode()); }