@NotNull
  private static List<LineMarkerInfo<PsiElement>> createJavaServiceLineMarkerInfo(@Nullable PsiIdentifier identifier,
                                                                                  @Nullable PsiClass implementerClass,
                                                                                  @Nullable PsiClass resultClass) {
    if (identifier == null || implementerClass == null || resultClass == null) return Collections.emptyList();
    if (!PsiUtil.isAvailable(JavaFeature.MODULES, identifier)) return Collections.emptyList();

    String implementerClassName = implementerClass.getQualifiedName();
    if (implementerClassName == null) return Collections.emptyList();

    PsiJavaModule javaModule = JavaModuleGraphUtil.findDescriptorByElement(identifier);
    if (javaModule == null) return Collections.emptyList();

    for (PsiProvidesStatement providesStatement : javaModule.getProvides()) {
      PsiClassType interfaceType = providesStatement.getInterfaceType();
      if (interfaceType == null) continue;
      PsiReferenceList implementationList = providesStatement.getImplementationList();
      if (implementationList == null) continue;

      PsiClassType[] implementationTypes = implementationList.getReferencedTypes();
      for (PsiClassType implementationType : implementationTypes) {
        if (!implementerClass.equals(implementationType.resolve())) continue;
        PsiClass interfaceClass = interfaceType.resolve();
        if (!InheritanceUtil.isInheritorOrSelf(resultClass, interfaceClass, true)) continue;
        String interfaceClassName = interfaceClass.getQualifiedName();
        if (interfaceClassName == null) continue;

        return Collections.singletonList(new LineMarkerInfo<>(identifier, identifier.getTextRange(), AllIcons.Gutter.Java9Service,
                                                              e -> calculateTooltip("service.provides", interfaceClassName),
                                                              new ServiceProvidesNavigationHandler(interfaceClassName,
                                                                                                   implementerClassName),
                                                              GutterIconRenderer.Alignment.LEFT,
                                                              () -> JavaAnalysisBundle.message("service.provides")));
      }
    }
    return Collections.emptyList();
  }
@NotNull
  private static List<LineMarkerInfo<PsiElement>> createJavaServiceLineMarkerInfo(@Nullable PsiIdentifier identifier,
                                                                                  @Nullable PsiClass implementerClass,
                                                                                  @Nullable PsiClass resultClass)