JType implements Type, Type.ArrayType { @Override public String fullyQualifiedName() { return fullyQualifiedName; } JType(JSema sema, ITypeBinding typeBinding); @Override boolean is(String fullyQualifiedName); @Override boolean isSubtypeOf(String fullyQualifiedName); @Override boolean isSubtypeOf(Type superType); @Override boolean isArray(); @Override boolean isClass(); @Override boolean isVoid(); @Override boolean isPrimitive(); @Override boolean isPrimitive(Primitives primitive); @Override boolean isUnknown(); @Override boolean isNumerical(); @Override String fullyQualifiedName(); @Override String name(); @Override String toString(); @Override Symbol.TypeSymbol symbol(); @Override Type erasure(); @Override Type elementType(); @Override boolean equals(Object obj); @Override int hashCode(); @Override boolean isParameterized(); @Override List<Type> typeArguments();  }
@Test void capture_type() { CompilationUnitTreeImpl cu = test("class A {\n" + " Object foo(java.util.List<? extends A> list) {\n" + " return list.get(0);\n" + " }\n" + "}"); cu.types().get(0); ClassTreeImpl c = (ClassTreeImpl) cu.types().get(0); MethodTreeImpl m = (MethodTreeImpl) c.members().get(0); ReturnStatementTreeImpl s = (ReturnStatementTreeImpl) Objects.requireNonNull(m.block()).body().get(0); AbstractTypedTree e = Objects.requireNonNull((AbstractTypedTree) s.expression()); Type captureType = e.symbolType(); assertThat(captureType.fullyQualifiedName()).isEqualTo("!capture!"); }