DeclaredType implements InferredType { @Override public boolean isIdentityComparableWith(InferredType other) { return true; } 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 isIdentityComparableWith() { DeclaredType aType = new DeclaredType(a); DeclaredType bType = new DeclaredType(b); DeclaredType cType = new DeclaredType(c); assertThat(aType.isIdentityComparableWith(bType)).isTrue(); assertThat(aType.isIdentityComparableWith(aType)).isTrue(); assertThat(aType.isIdentityComparableWith(new RuntimeType(a))).isTrue(); assertThat(aType.isIdentityComparableWith(AnyType.ANY)).isTrue(); assertThat(aType.isIdentityComparableWith(or(aType, bType))).isTrue(); assertThat(aType.isIdentityComparableWith(or(cType, bType))).isTrue(); }