docs: @Requires({
      "elements != null",
      "!elements.contains(null)",
      "clazz != null",
      "kinds != null"
    })
    @SuppressWarnings("unchecked")
    public static <T extends ElementModel> List<? extends T> filter(
        List<? extends ElementModel> elements, Class<T> clazz,
        ElementKind... kinds) {
      ArrayList<T> result = new ArrayList<T>();
      List<ElementKind> list = Arrays.asList(kinds);
      for (ElementModel element : elements) {
        if (list.contains(element.getKind())
            && clazz.isAssignableFrom(element.getClass())) {
          result.add((T) element);
        }
      }
      return Collections.unmodifiableList(result);
    }