title: How verify a ScheduledExecutorService has started?
body: <p><strong>Description</strong>  </p>
  
  <p>A task A is running, that can last from 2s to 60+s.</p>
  
  <p>While  A is running, I scheduled a ExecutorService that after 10s (delay), would print "running" every 5s (fixed rate).</p>
  
  <pre><code>ScheduledExecutorService scheduleNotifications = Executors
          .newSingleThreadScheduledExecutor();
  scheduleNotifications.scheduleAtFixedRate(new Runnable() {
      @Override
      public void run() {
          System.out.println("A is running");
      }
  }, 10, 5, TimeUnit.SECONDS);
  </code></pre>
  
  <p>Once A is done, I wish to print "A is done." <strong>but only if my ScheduledExecutorService task has started</strong>, meaning it printed "running" at least once.</p>
  
  <ul>
  <li>If A finished before 10s, I do not print anything.</li>
  <li>If A takes more than 10s, I print "running" every 5s and then "done" once A is finished.</li>
  </ul>
  
  <p>How could I do that without using a boolean flag inside the schduled <code>runnable</code>. Is there a way to check that my service started?</p>