+ /**
+ * Filter that removes all albums that do not have any images in any album
+ * below it.
+ */
+ public static final Predicate<Album> NOT_EMPTY = new Predicate<Album>() {
+
+ @Override
+ public boolean apply(Album album) {
+ return FluentIterable.from(asList(album)).transformAndConcat(FLATTENER).anyMatch(new Predicate<Album>() {
+
+ @Override
+ public boolean apply(Album album) {
+ return !album.getImages().isEmpty();
+ }
+ });
+ }
+ };
+