private static @Nullable NestedControllerCandidate findNestedControllerCandidate(@NotNull PsiElement element) {
    if (element instanceof PsiField field) {
      final String fxId = field.getName();
      if (!StringUtil.isEmpty(fxId)) {
        final PsiClass containingClass = field.getContainingClass();
        if (containingClass != null) {
          final PsiField nestedControllerField = containingClass.findFieldByName(fxId + FxmlConstants.CONTROLLER_SUFFIX, true);
          if (nestedControllerField != null) {
            final PsiType psiType = nestedControllerField.getType();
            if (!(psiType instanceof PsiPrimitiveType) && !(psiType instanceof PsiArrayType)) { // optimization
              return new NestedControllerCandidate(fxId, nestedControllerField, containingClass);
            }
          }
        }
      }
    }
    return null;
  }
private static @Nullable NestedControllerCandidate findNestedControllerCandidate(@NotNull PsiElement element)