title: Can I check the size of a collection as it is being populated
body: <p>I'm listing the files on a file system in Java using the following Apache Commons class:</p>
  
  <p><code>Collection&lt;File&gt; allFiles = FileUtils.listFiles(rootDirectory, null, recursive);</code></p>
  
  <p>This is a very long process, and can take up to 5 minutes.</p>
  
  <p>Is there any way I can check the size of the collection <strong>while it is being populated?</strong></p>
  
  <p>I tried accessing it from a separate thread but simply got zero until the process was ready.</p>