class CronThreadPoolExecutor extends ScheduledThreadPoolExecutor implements CronExecutorService {

    public CronThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory) {
        super(corePoolSize, threadFactory);
    }

    @Override
    public ScheduledFuture<?> submit(Task task) {<FILL_FUNCTION_BODY>}

}

        if (task == null) throw new NullPointerException();
        CronExpression expression = task.getCronExpression();
        Runnable scheduleTask = () -> {
            Date now  = new Date();
            Date time = expression.getNextValidTimeAfter(now);
            try {
                while (time != null) {
                    if (!task.isRunning()) {
                        break;
                    }
                    CronThreadPoolExecutor.this.schedule(task.getTask(), time.getTime() - now.getTime(), TimeUnit.MILLISECONDS);
                    while (now.before(time)) {
                        Thread.sleep(time.getTime() - now.getTime());
                        now = new Date();
                    }
                    time = expression.getNextValidTimeAfter(now);
                }
            } catch (RejectedExecutionException | CancellationException e) {
                // Occurs if executor was already shutdown when schedule() is called
            } catch (InterruptedException e) {
                // Occurs when executing tasks are interrupted during shutdownNow()
                Thread.currentThread().interrupt();
            }
        };
        return this.schedule(scheduleTask, task.getDelay(), TimeUnit.MILLISECONDS);
    
<methods>public void <init>(int) ,public void <init>(int, java.util.concurrent.ThreadFactory) ,public void <init>(int, java.util.concurrent.RejectedExecutionHandler) ,public void <init>(int, java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler) ,public void execute(java.lang.Runnable) ,public boolean getContinueExistingPeriodicTasksAfterShutdownPolicy() ,public boolean getExecuteExistingDelayedTasksAfterShutdownPolicy() ,public BlockingQueue<java.lang.Runnable> getQueue() ,public boolean getRemoveOnCancelPolicy() ,public ScheduledFuture<?> schedule(java.lang.Runnable, long, java.util.concurrent.TimeUnit) ,public ScheduledFuture<V> schedule(Callable<V>, long, java.util.concurrent.TimeUnit) ,public ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit) ,public ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit) ,public void setContinueExistingPeriodicTasksAfterShutdownPolicy(boolean) ,public void setExecuteExistingDelayedTasksAfterShutdownPolicy(boolean) ,public void setRemoveOnCancelPolicy(boolean) ,public void shutdown() ,public List<java.lang.Runnable> shutdownNow() ,public Future<?> submit(java.lang.Runnable) ,public Future<T> submit(Callable<T>) ,public Future<T> submit(java.lang.Runnable, T) <variables>private static final long DEFAULT_KEEPALIVE_MILLIS,private volatile boolean continueExistingPeriodicTasksAfterShutdown,private volatile boolean executeExistingDelayedTasksAfterShutdown,volatile boolean removeOnCancel,private static final java.util.concurrent.atomic.AtomicLong sequencer