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