private static List<Pair<PsiMethod, PsiSubstitutor>> getTemplateTargets(@NotNull PsiTemplateExpression methodCall,
                                                                          @NotNull PsiMethod baseMethod) {
    PsiExpression processor = methodCall.getProcessor();
    if (processor == null) return Collections.emptyList();
    PsiType type = processor.getType();
    if (type == null) return Collections.emptyList();
    List<Pair<PsiMethod, PsiSubstitutor>> candidates = new ArrayList<>();
    // Resolve other signatures in case of multiple interface inheritance
    for (PsiClassType classType : PsiTypesUtil.getClassTypeComponents(type)) {
      if (InheritanceUtil.isInheritor(classType, CommonClassNames.JAVA_LANG_STRING_TEMPLATE_PROCESSOR)) {
        final PsiClassType.ClassResolveResult resolveResult = classType.resolveGenerics();
        final PsiClass aClass = resolveResult.getElement();
        if (aClass == null) continue;
        for (PsiMethod foundMethod : aClass.findMethodsBySignature(baseMethod, true)) {
          if (foundMethod == baseMethod) continue;
          PsiClass methodContainingClass = foundMethod.getContainingClass();
          if (methodContainingClass == null) continue;
          final PsiSubstitutor substitutor =
            TypeConversionUtil.getClassSubstitutor(methodContainingClass, aClass, resolveResult.getSubstitutor());
          if (substitutor == null) continue;
          candidates.add(Pair.create(foundMethod, substitutor));
        }
      }
    }
    return candidates;
  }
private static List<Pair<PsiMethod, PsiSubstitutor>> getTemplateTargets(@NotNull PsiTemplateExpression methodCall,
                                                                          @NotNull PsiMethod baseMethod)