class DefaultToArrayGeneratorTerminator<ENTITY> implements ToArrayGeneratorTerminator<ENTITY> {

    private DefaultToArrayGeneratorTerminator() {
    }

    @Override
    public <T, A> A[] apply(
        final SqlStreamOptimizerInfo<ENTITY> info,        
        final SqlStreamTerminator<ENTITY> sqlStreamTerminator,
        final ReferencePipeline<T> pipeline,
        final IntFunction<A[]> generator
    ) {<FILL_FUNCTION_BODY>}

    public static final ToArrayGeneratorTerminator<?> DEFAULT = new DefaultToArrayGeneratorTerminator<>();

}

        requireNonNull(info);
        requireNonNull(sqlStreamTerminator);
        requireNonNull(pipeline);
        requireNonNull(generator);

        final ReferencePipeline<T> optimizedPipeline = sqlStreamTerminator.optimize(pipeline);
        return sqlStreamTerminator
            .attachTraceData(optimizedPipeline)
            .getAsReferenceStream().toArray(generator);
    
<no_super_class>