public static boolean isAccessibleMember(@NotNull PsiMember classMember,
                                           @NotNull PsiClass outerClass,
                                           @Nullable PsiExpression qualifier) {
    if (!isPublicMember(classMember)) {
      return false;
    }

    if (qualifier != null) {
      return isQualifierAccessible(qualifier);
    }

    // consider member as inaccessible if it has no qualifier and in the same file as outer class
    return !Objects.equals(outerClass.getContainingFile(), classMember.getContainingFile());
  }
public static boolean isAccessibleMember(@NotNull PsiMember classMember,
                                           @NotNull PsiClass outerClass,
                                           @Nullable PsiExpression qualifier)