presto-main/src/main/java/io/prestosql/sql/planner/optimizations/QueryCardinalityUtil.java/QueryCardinalityUtil/isAtMost
class QueryCardinalityUtil:    public static boolean isAtMost(PlanNode node, Lookup lookup, long maxCardinality)
    {
        return Range.closed(0L, maxCardinality).encloses(extractCardinality(node, lookup));
    }