@Override
  public Object @NotNull [] getVariants() {
    final String type = getMemberType(myElement);
    if (type != null) {
      final ReflectiveClass ownerClass = getOwnerClass();
      if (ownerClass != null) {
        return switch (type) {
          case GET_DECLARED_FIELD -> Arrays.stream(ownerClass.getPsiClass().getFields())
            .sorted(Comparator.comparing(PsiField::getName))
            .map(field -> JavaLookupElementBuilder.forField(field))
            .toArray();
          case GET_FIELD -> StreamEx.of(ownerClass.getPsiClass().getAllFields())
            .filter(field -> isPotentiallyAccessible(field, ownerClass))
            .distinct(field -> field.getName())
            .sorted(Comparator.comparingInt((PsiField field) -> isPublic(field) ? 0 : 1).thenComparing(PsiField::getName))
            .map(field -> withPriority(JavaLookupElementBuilder.forField(field), isPublic(field)))
            .toArray();
          case GET_DECLARED_METHOD -> StreamEx.of(ownerClass.getPsiClass().getMethods())
            .filter(method -> isRegularMethod(method))
            .sorted(Comparator.comparing(PsiMethod::getName))
            .map(method -> lookupMethod(method, this))
            .nonNull()
            .toArray();
          case GET_METHOD -> StreamEx.of(ownerClass.getPsiClass().getVisibleSignatures())
            .map(MethodSignatureBackedByPsiMethod::getMethod)
            .filter(method -> isRegularMethod(method) && isPotentiallyAccessible(method, ownerClass))
            .sorted(Comparator.comparingInt((PsiMethod method) -> getMethodSortOrder(method)).thenComparing(PsiMethod::getName))
            .map(method -> withPriority(lookupMethod(method, this), -getMethodSortOrder(method)))
            .nonNull()
            .toArray();
          case NEW_UPDATER -> Arrays.stream(ownerClass.getPsiClass().getFields())
            .sorted(Comparator.comparingInt((PsiField field) -> isAtomicallyUpdateable(field) ? 0 : 1).thenComparing(PsiField::getName))
            .map(field -> withPriority(JavaLookupElementBuilder.forField(field), isAtomicallyUpdateable(field)))
            .toArray();
          default -> EMPTY_ARRAY;
        };
      }
    }
    return EMPTY_ARRAY;
  }
@Override
  public Object @NotNull [] getVariants()