The methods ScheduledExecutorService#scheduleAtFixedRate() and ScheduledExecutorService#scheduleWithFixedDelay() repeat the task periodically and both return ScheduledFuture<?>, that means the get() method will always return null for them. These futures, however, can be cancelled based on some condition.