title: java 8 lambda expression for FilenameFilter
body: <p>I am going through the lambda expression in java 8 </p>
  
  <p>when i changed the code of thread it's working fine </p>
  
  <pre><code>new Thread(new Runnable() {
      @Override
      public void run() {
          System.out.println("run");
      }
  }).start();
  </code></pre>
  
  <p>is converted to lambda expression as</p>
  
  <pre><code>new Thread(
      () -&gt; System.out.println("Hello from thread")
  ).start();
  </code></pre>
  
  <p>But i am not able to convert the FilenameFilter Expression </p>
  
  <pre><code>File file = new File("/home/text/xyz.txt");
  file.list(new FilenameFilter() {
      @Override
      public boolean accept(File dir, String name) {
          name.endsWith(".txt");
          return false;
      }
  });
  </code></pre>
  
  <p>and unsuccessfully converted to this as </p>
  
  <pre><code>file.list(new FilenameFilter () {
      (File a1, String a2) -&gt; { 
          return false;
      }
  });
  </code></pre>
  
  <p>it's giving error as in eclipse as </p>
  
  <blockquote>
    <p>Multiple markers at this line<br>
      - Syntax error, insert ";" to complete Statement<br>
      - Syntax error, insert "}" to complete Block<br>
      - Syntax error, insert "AssignmentOperator Expression" to complete       Assignment</p>
  </blockquote>