JSymbolMetadata implements SymbolMetadata { @Override public List<AnnotationInstance> annotations() { if (annotations == null) { annotations = Arrays.stream(annotationBindings) .map(sema::annotation) .collect(Collectors.toList()); } return annotations; } JSymbolMetadata(JSema sema, IAnnotationBinding[] annotationBindings);   JSymbolMetadata(JSema sema, IAnnotationBinding[] typeAnnotationBindings, IAnnotationBinding[] annotationBindings); @Override List<AnnotationInstance> annotations(); @Override final boolean isAnnotatedWith(String fullyQualifiedName); @Nullable @Override final List<AnnotationValue> valuesForAnnotation(String fullyQualifiedNameOfAnnotation);  }
@Test void should_convert_annotation_values() { JavaTree.CompilationUnitTreeImpl cu = test("import java.lang.annotation.*; @Target({ElementType.TYPE, ElementType.METHOD}) @interface A { }"); ClassTreeImpl c = (ClassTreeImpl) cu.types().get(0); Object[] value = (Object[]) cu.sema.typeSymbol(c.typeBinding).metadata().annotations().get(0).values().get(0).value(); assertThat(value).hasSize(2); assertThat(((JVariableSymbol) value[0]).isEnum()).isTrue(); assertThat(((JVariableSymbol) value[1]).isEnum()).isTrue(); }