public boolean accept(final File file){
  return file.isDirectory() || hasExtension(file,extension);
}

public boolean accept ( final File file ) { return file . isDirectory ( ) || hasExtension ( file , extension ) ; }
determines if the file has the correct extension type .
