public static PsiMethod @Nullable [] getResourceCloserMethodsForType(@NotNull PsiClassType resourceType) {
    PsiClass resourceClass = resourceType.resolve();
    if (resourceClass == null) return null;

    Project project = resourceClass.getProject();
    JavaPsiFacade facade = JavaPsiFacade.getInstance(project);
    PsiClass autoCloseable = facade.findClass(CommonClassNames.JAVA_LANG_AUTO_CLOSEABLE, ProjectScope.getLibrariesScope(project));
    if (autoCloseable == null) return null;

    if (JavaClassSupers.getInstance().getSuperClassSubstitutor(autoCloseable, resourceClass, resourceType.getResolveScope(), PsiSubstitutor.EMPTY) == null) {
      return null;
    }

    PsiMethod[] closes = autoCloseable.findMethodsByName("close", false);
    if (closes.length == 1) {
      return resourceClass.findMethodsBySignature(closes[0], true);
    }
    return null;
  }
public static PsiMethod @Nullable [] getResourceCloserMethodsForType(@NotNull PsiClassType resourceType)