public boolean accept(final File file){
  return (file.isDirectory()) || extensions.contains(getExtension(file));
}

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