code: public static Specification<JpaTarget> hasInstalledOrAssignedDistributionSet(@NotNull final Long distributionId) {
          return (targetRoot, query, cb) -> cb.or(
                  cb.equal(targetRoot.get(JpaTarget_.installedDistributionSet).get(JpaDistributionSet_.id),
                          distributionId),
                  cb.equal(targetRoot.<JpaDistributionSet> get(JpaTarget_.assignedDistributionSet)
                          .get(JpaDistributionSet_.id), distributionId));
      }
docs: {@link Specification} for retrieving {@link Target}s by "like
  controllerId".
  
  @param distributionId
  to be filtered on
  @return the {@link Target} {@link Specification}