static HighlightInfo.Builder checkModuleReference(@NotNull PsiRequiresStatement statement) {
    PsiJavaModuleReferenceElement refElement = statement.getReferenceElement();
    if (refElement != null) {
      PsiJavaModuleReference ref = refElement.getReference();
      assert ref != null : refElement.getParent();
      PsiJavaModule target = ref.resolve();
      if (target == null) {
        if (ref.multiResolve(true).length == 0) {
          if (IncompleteModelUtil.isIncompleteModel(statement)) {
            return HighlightUtil.getPendingReferenceHighlightInfo(refElement);
          }
          String message = JavaErrorBundle.message("module.not.found", refElement.getReferenceText());
          return HighlightInfo.newHighlightInfo(HighlightInfoType.WRONG_REF).range(refElement).descriptionAndTooltip(message);
        }
        else if (ref.multiResolve(false).length > 1) {
          String message = JavaErrorBundle.message("module.ambiguous", refElement.getReferenceText());
          return HighlightInfo.newHighlightInfo(HighlightInfoType.WARNING).range(refElement).descriptionAndTooltip(message);
        }
        else {
          String message = JavaErrorBundle.message("module.not.on.path", refElement.getReferenceText());
          HighlightInfo.Builder info = HighlightInfo.newHighlightInfo(HighlightInfoType.WRONG_REF).range(refElement).descriptionAndTooltip(message);
          List<IntentionAction> registrar = new ArrayList<>();
          QuickFixFactory.getInstance().registerOrderEntryFixes(ref, registrar);
          QuickFixAction.registerQuickFixActions(info, null, registrar);
          return info;
        }
      }
      PsiJavaModule container = (PsiJavaModule)statement.getParent();
      if (target == container) {
        String message = JavaErrorBundle.message("module.cyclic.dependence", container.getName());
        return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(refElement).descriptionAndTooltip(message);
      }
      else {
        Collection<PsiJavaModule> cycle = JavaModuleGraphUtil.findCycle(target);
        if (cycle.contains(container)) {
          Stream<String> stream = cycle.stream().map(PsiJavaModule::getName);
          if (ApplicationManager.getApplication().isUnitTestMode()) stream = stream.sorted();
          String message = JavaErrorBundle.message("module.cyclic.dependence", stream.collect(Collectors.joining(", ")));
          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(refElement).descriptionAndTooltip(message);
        }
      }
    }

    return null;
  }
static HighlightInfo.Builder checkModuleReference(@NotNull PsiRequiresStatement statement)