title: How to mock executorService.submit()
body: <p>How can I mock executorService.submit() in the below scenerio. I have to mock </p>
  
  <p>cacheController.someMethod(); but as submit method is called it creates a thread and cacheController.someMethod(); never gets called for test class.</p>
  
  <pre><code>@Autowired
  CacheController cacheController;
  protected static final ExecutorService EXECUTOR = Executors.newFixedThreadPool(1);
  
  EXECUTOR.submit(() -&gt; {
          try {
              cacheController.someMethod();
          } catch (Exception e) {
              e.printStackTrace();
          }
      });
  </code></pre>