How does the FutureTask in collection works internally?
<p>I am trying to understand the working of <code>FutureTask</code> in <code>Collections</code>. From what I read I understand you can create a thread pool using <code>ExecutorService</code>. Later you can wrap <code>Runnable</code> or <code>Callable</code> in <code>FutureTask</code> and execute it. After that you can use the Future object to check get the results or check if task is running. But how does this do internally ?</p>

<p>What I am trying to understand is what happens behind the scene when you pass a Callable interface. Few questions I have are</p>

<ol>
<li><p>Does the FutureTask itself runs a thread internally to constantly check if the Callable command has finished execution ? If not then how does it know when the command is finished execution?</p></li>
<li><p>How does the get() method work? How does it get the value that is returned from the Callable interface ?</p></li>
</ol>

<p>Looking at the documentation I couldn't figure out much. Is there any code  example that I can look at to understand the behind the scenes.</p>