title: How should I unit test code that uses the google guava libraries, especially stuff in the io package?
body: <p>A lot of the functionality in guava is provided by static methods.  I haven't figured out how to merge the use of guava libraries and good Dependency Injection practice.</p>
  
  <p>For example, if I were to use</p>
  
  <pre><code>Files.readLines(File, Charset)
  </code></pre>
  
  <p>then I find I have a hard time writing a unit test which doesn't touch the filesystem, which I only like to do for integration testing.</p>
  
  <p>I guess it's possible that I could write an adapter for all of the ones I'm interested in?  But that could possibly end up being a lot of work...</p>
  
  <p>I find it odd that the guava libraries come from the same set of people that provide guice and write blog posts like <a href="http://misko.hevery.com/2008/12/15/static-methods-are-death-to-testability/" rel="noreferrer">this</a></p>