class OptimizedIntCountTerminator<ENTITY> implements IntCountTerminator<ENTITY> {

    private OptimizedIntCountTerminator() {}

    @Override
    public long apply(
        final SqlStreamOptimizerInfo<ENTITY> info,
        final SqlStreamTerminator<ENTITY> sqlStreamTerminator,
        final IntPipeline pipeline
    ) {<FILL_FUNCTION_BODY>}

    public static final IntCountTerminator<?> INSTANCE = new OptimizedIntCountTerminator<>();

    @SuppressWarnings("unchecked")
    public static <ENTITY> IntCountTerminator<ENTITY> create() {
        return (IntCountTerminator<ENTITY>) INSTANCE;
    }

}

        requireNonNull(info);
        requireNonNull(sqlStreamTerminator);
        requireNonNull(pipeline);
        return countHelper(
            info,
            sqlStreamTerminator,
            pipeline,
            () -> IntCountTerminator.<ENTITY>defaultTerminator().apply(info, sqlStreamTerminator, pipeline)
        );
    
<no_super_class>