code: boolean isInheritedAndNotPublic(TypeElement concreteClass, TypeElement declaringClass, Element methodOrField) {
          PackageElement packageOfDeclaringClass = elementUtils.getPackageOf(declaringClass);
          PackageElement packageOfConcreteClass = elementUtils.getPackageOf(concreteClass);
  
          return declaringClass != concreteClass &&
              !packageOfDeclaringClass.getQualifiedName().equals(packageOfConcreteClass.getQualifiedName())
              && (isProtected(methodOrField) || !isPublic(methodOrField));
      }
docs: Return whether the given method or field is inherited but not public.
  
  @param concreteClass  The concrete class
  @param declaringClass The declaring class of the field
  @param methodOrField  The method or field
  @return True if it is inherited and not public