code: protected <X extends Comparable<? super X>> Specification<ENTITY> buildSpecification(RangeFilter<X> filter,
                                                                                           Function<Root<ENTITY>, Expression<X>> metaclassFunction) {
          if (filter.getEquals() != null) {
              return equalsSpecification(metaclassFunction, filter.getEquals());
          } else if (filter.getIn() != null) {
              return valueIn(metaclassFunction, filter.getIn());
          }
  
          Specification<ENTITY> result = Specification.where(null);
          if (filter.getSpecified() != null) {
              result = result.and(byFieldSpecified(metaclassFunction, filter.getSpecified()));
          }
          if (filter.getGreaterThan() != null) {
              result = result.and(greaterThan(metaclassFunction, filter.getGreaterThan()));
          }
          if (filter.getGreaterOrEqualThan() != null) {
              result = result.and(greaterThanOrEqualTo(metaclassFunction, filter.getGreaterOrEqualThan()));
          }
          if (filter.getLessThan() != null) {
              result = result.and(lessThan(metaclassFunction, filter.getLessThan()));
          }
          if (filter.getLessOrEqualThan() != null) {
              result = result.and(lessThanOrEqualTo(metaclassFunction, filter.getLessOrEqualThan()));
          }
          return result;
      }
docs: Helper function to return a specification for filtering on a single {@link Comparable}, where equality, less
  than, greater than and less-than-or-equal-to and greater-than-or-equal-to and null/non-null conditions are
  supported.
  
  @param filter            the individual attribute filter coming from the frontend.
  @param metaclassFunction lambda, which based on a Root&lt;ENTITY&gt; returns Expression - basicaly picks a column
  @param <X>               The type of the attribute which is filtered.
  @return a Specification