private static void adjustVisibilityOfProtectedMembers(PsiClass aClass) {
    StreamEx.<PsiMember>of(aClass.getMethods()).append(aClass.getFields()).forEach(member -> {
      if (!member.hasModifierProperty(PsiModifier.PROTECTED)) return;
      if (member instanceof PsiMethod method && !method.isConstructor() &&
          !PsiSuperMethodImplUtil.getHierarchicalMethodSignature(method).getSuperSignatures().isEmpty()) {
        return;
      }
      PsiModifierList memberModifierList = member.getModifierList();
      if (memberModifierList == null) return;
      boolean canBePrivate = ProtectedMemberInFinalClassInspection.canBePrivate(member, memberModifierList);
      memberModifierList.setModifierProperty(canBePrivate ? PsiModifier.PRIVATE : PsiModifier.PACKAGE_LOCAL, true);
    });
  }
private static void adjustVisibilityOfProtectedMembers(PsiClass aClass)