List<TypeAnnotation> ( List<TypeAnnotation> typeAnnotations, int typeParameterIndex, int boundIndex ) { return typeAnnotations.stream() .filter(typeAnnotation -> { TargetInfo targetInfo = typeAnnotation.getTargetInfo(); return targetInfo instanceof TypeParameterBoundTarget && ((TypeParameterBoundTarget)targetInfo).getTypeParameterIndex() == typeParameterIndex && ((TypeParameterBoundTarget)targetInfo).getBoundIndex() == boundIndex; }).collect(Collectors.toList()); }