driver-core/src/main/com/mongodb/client/model/Aggregates.java
public static <TExpression, TBoundary> Bson bucket(final TExpression groupBy, final List<TBoundary> boundaries,
                                                       final BucketOptions options) {
        return new BucketStage<TExpression, TBoundary>(groupBy, boundaries, options);
    }
public static <TExpression, TBoundary> Bson bucket(final TExpression groupBy, final List<TBoundary> boundaries,
                                                       final BucketOptions options) {
        return new BucketStage<TExpression, TBoundary>(groupBy, boundaries, options);
    }
public static < TExpression , TBoundary > Bson bucket ( final TExpression groupBy , final List < TBoundary > boundaries , final BucketOptions options ) { return new BucketStage < TExpression , TBoundary > ( groupBy , boundaries , options ) ; }
Creates a $bucket pipeline stage

@param <TExpression> the groupBy expression type
@param <TBoundary>    the boundary type
@param groupBy       the criteria to group By
@param boundaries    the boundaries of the buckets
@param options       the optional values for the $bucket stage
@return the $bucket pipeline stage
@mongodb.driver.manual reference/operator/aggregation/bucket/ $bucket
@mongodb.server.release 3.4
@since 3.4
Creates a $bucket pipeline stage