The author was only showing you the interface and what all methods it contains. You don't have to re-invent the wheel.
As told by the above poster, pass an instance of java.io.FileNameFilter. so remove that interface from your compilation
unit and
you should be good.