/** * {@inheritDoc} */ public AnnotationList getInheritedAnnotations() { Generic superClass = getSuperClass(); AnnotationList declaredAnnotations = getDeclaredAnnotations(); if (superClass == null) { return declaredAnnotations; } else { Set<TypeDescription> annotationTypes = new HashSet<TypeDescription>(); for (AnnotationDescription annotationDescription : declaredAnnotations) { annotationTypes.add(annotationDescription.getAnnotationType()); } return new AnnotationList.Explicit(CompoundList.of(declaredAnnotations, superClass.asErasure().getInheritedAnnotations().inherited(annotationTypes))); } }