RuntimeType implements InferredType { public boolean mustBeOrExtend(String fullyQualifiedName) { return typeClass.isOrExtends(fullyQualifiedName); } RuntimeType(ClassSymbol typeClass); @Override boolean isIdentityComparableWith(InferredType other); @Override boolean canHaveMember(String memberName); @Override boolean declaresMember(String memberName); @Override Optional<Symbol> resolveMember(String memberName); @Override Optional<Symbol> resolveDeclaredMember(String memberName); @Override boolean canOnlyBe(String typeName); @Override boolean canBeOrExtend(String typeName); @Override boolean isCompatibleWith(InferredType other); boolean mustBeOrExtend(String fullyQualifiedName); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); ClassSymbol getTypeClass();  }
@Test public void test_mustBeOrExtend() { ClassSymbolImpl x1 = new ClassSymbolImpl("x1", "x1"); ClassSymbolImpl x2 = new ClassSymbolImpl("x2", "x2"); x2.addSuperClass(x1); RuntimeType typeX1 = new RuntimeType(x1); RuntimeType typeX2 = new RuntimeType(x2); assertThat(typeX1.mustBeOrExtend("x1")).isTrue(); assertThat(typeX1.mustBeOrExtend("x2")).isFalse(); assertThat(typeX2.mustBeOrExtend("x1")).isTrue(); assertThat(typeX2.mustBeOrExtend("x2")).isTrue(); }