class DelayOptimization implements Optimization {

    private final DelayParameters delayParameters;
    private final OptimizationListener listener;
    private final TimeMeter timeMeter;

    public DelayOptimization(DelayParameters delayParameters, OptimizationListener listener, TimeMeter timeMeter) {
        this.delayParameters = delayParameters;
        this.timeMeter = timeMeter;
        this.listener = listener;
    }

    @Override
    public Optimization withListener(OptimizationListener listener) {
        return new DelayOptimization(delayParameters, listener, timeMeter);
    }

    @Override
    public CommandExecutor apply(CommandExecutor originalExecutor) {<FILL_FUNCTION_BODY>}

    @Override
    public AsyncCommandExecutor apply(AsyncCommandExecutor originalExecutor) {
        DelayedCommandExecutor predictiveCommandExecutor = new DelayedCommandExecutor(originalExecutor, delayParameters, listener, timeMeter);
        return new AsyncBatchingExecutor(predictiveCommandExecutor, listener);
    }

}

        DelayedCommandExecutor predictiveCommandExecutor = new DelayedCommandExecutor(originalExecutor, delayParameters, listener, timeMeter);
        return new BatchingExecutor(predictiveCommandExecutor, listener);
    
<no_super_class>