@NotNull
  public static <T extends PsiElement> List<T> getMembersOfType(@NotNull final PyClassLikeType type,
                                                                @NotNull final Class<T> expectedMemberType,
                                                                boolean inherited,
                                                                @NotNull final TypeEvalContext context) {

    final List<T> result = new ArrayList<>();
    type.visitMembers(t -> {
      if (expectedMemberType.isInstance(t)) {
        @SuppressWarnings("unchecked") // Already checked
        final T castedElement = (T)t;
        result.add(castedElement);
      }
      return true;
    }, inherited, context);
    return result;
  }
@NotNull
  public static <T extends PsiElement> List<T> getMembersOfType(@NotNull final PyClassLikeType type,
                                                                @NotNull final Class<T> expectedMemberType,
                                                                boolean inherited,
                                                                @NotNull final TypeEvalContext context)