code: public static Set<Class<?>> findTypesAnnotatedWith(Class<? extends Annotation> annotation, Set<Class<?>> types) {
          if (annotation == null) {
              throw new IllegalArgumentException("An annotation type must be specified.");
          }
  
          return types.stream().filter(c -> c.isAnnotationPresent(annotation)).collect(Collectors.toSet());
      }
docs: Finds the set of types that are annotated with the specified annotation.
  
  @param annotation        the Annotation to find
  @param types             the set of Class objects to search through
  @return                  a Set of Class objects, or an empty set of none could be found