title: How to distinguish FileFilter and FilenameFilter in Groovy?
body: <p>I would like to list files of certain types and wrote:</p>
  
  <pre><code>File[] imageFiles = srcDir.listFiles({ File file -&gt;
              file().name.endsWith("Artboard1ldpi.png") ||
              file().name.endsWith("Artboard1mdpi.png") ||
              file().name.endsWith("Artboard1hdpi.png") ||
              file().name.endsWith("Artboard1xhdpi.png") ||
              file().name.endsWith("Artboard1xxhdpi.png") ||
              file().name.endsWith("Artboard1xxxhdpi.png")
          })
  </code></pre>
  
  <p>Unfortunately, I am getting the following error:</p>
  
  <pre><code>&gt; Ambiguous method overloading for method java.io.File#listFiles.
  Cannot resolve which method to invoke for [class CLOSURENAME] due to overlapping prototypes between:
      [interface java.io.FileFilter]
      [interface java.io.FilenameFilter]
  </code></pre>
  
  <p>How to hint Groovy, what to choose?</p>