List<LineMarkerInfo<PsiElement>> (@Nullable PsiIdentifier identifier, @Nullable PsiClass implementerClass, @Nullable PsiClass resultClass) { if (identifier != null && implementerClass != null && resultClass != null) { String implementerClassName = implementerClass.getQualifiedName(); if (implementerClassName != null && PsiUtil.isLanguageLevel9OrHigher(identifier)) { PsiJavaModule javaModule = JavaModuleGraphUtil.findDescriptorByElement(identifier); if (javaModule != null) { for (PsiProvidesStatement providesStatement : javaModule.getProvides()) { PsiClassType interfaceType = providesStatement.getInterfaceType(); PsiReferenceList implementationList = providesStatement.getImplementationList(); if (interfaceType != null && implementationList != null) { PsiClassType[] implementationTypes = implementationList.getReferencedTypes(); for (PsiClassType implementationType : implementationTypes) { if (implementerClass.equals(implementationType.resolve())) { PsiClass interfaceClass = interfaceType.resolve(); if (InheritanceUtil.isInheritorOrSelf(resultClass, interfaceClass, true)) { String interfaceClassName = interfaceClass.getQualifiedName(); if (interfaceClassName != null) { LineMarkerInfo<PsiElement> info = new LineMarkerInfo<>(identifier, identifier.getTextRange(), AllIcons.Gutter.Java9Service, e -> calculateTooltip("service.provides", interfaceClassName), new ServiceProvidesNavigationHandler(interfaceClassName, implementerClassName), GutterIconRenderer.Alignment.LEFT); return Collections.singletonList(info); } } } } } } } } } return Collections.emptyList(); }