List<TypeAnnotation> (List<TypeAnnotation> typeAnnotations, int superTypeIndex) { return typeAnnotations.stream() .filter(typeAnnotation -> { TargetInfo targetInfo = typeAnnotation.getTargetInfo(); return targetInfo instanceof SupertypeTarget && ((SupertypeTarget)targetInfo).getSupertypeIndex() == superTypeIndex; }).collect(Collectors.toList()); }