public static Predicate<File> isDirectoryPredicate() {
    return new Predicate<File>() {
      @Override
      public boolean apply(final File input) {
        return input.isDirectory();
      }
    };
  }
public static Predicate < File > isDirectoryPredicate ( ) { return new Predicate < File > ( ) { @ Override public boolean apply ( final File input ) { return input . isDirectory ( ) ; } } ; }
Guava predicates and functions