class OrderedDocCollector implements Supplier<KeyIterable<ShardId, Row>>, AutoCloseable, Killable {

    private final ShardId shardId;
    protected final KeyIterable<ShardId, Row> empty;

    boolean exhausted = false;

    public static OrderedDocCollector empty(ShardId shardId) {<FILL_FUNCTION_BODY>}

    OrderedDocCollector(ShardId shardId) {
        this.shardId = shardId;
        empty = new KeyIterable<>(shardId, Collections.<Row>emptyList());
    }

    public ShardId shardId() {
        return shardId;
    }

    @Override
    public void close() {
    }

    @Override
    public void kill(@NotNull Throwable t) {
    }

    /**
     * Returns an iterable for a batch of rows. In order to consume all rows of this collector,
     * {@code #get()} needs to be called while {@linkplain #exhausted()} is {@code false}.
     * After {@linkplain #exhausted()} is {@code true}, all subsequent calls to {@code #get()}
     * will return an empty iterable.
     *
     * @return an iterable for the next batch of rows.
     */
    @Override
    public KeyIterable<ShardId, Row> get() {
        return collect();
    }

    protected abstract KeyIterable<ShardId, Row> collect();

    /**
     * Returns {@code true} if this collector has no rows to deliver anymore.
     */
    public boolean exhausted() {
        return exhausted;
    }

    public KeyIterable<ShardId, Row> empty() {
        return empty;
    }
}

        return new OrderedDocCollector(shardId) {

            @Override
            protected KeyIterable<ShardId, Row> collect() {
                return empty;
            }

            @Override
            public boolean exhausted() {
                return true;
            }
        };
    
<no_super_class>