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