threerings/aspirin — comment on commit 7d338ef37d8de4883dfa0bd748781ef6935998b7
File:  line 0
By raygreenwell:

Guava's Predicates class lets you pass in 0 Predicates to and() and or().

That seems reasonable to me.

Let's say you're filtering something based on predicates, according to some externally-supplied data:

List preds = Lists.newArrayList();
if (userData.filterDeadBeatDads) {
preds.add(MyPredicates.NO_DEADBEATS);
}
if (userData.filterAlaskans) {
preds.add(MyPredicates.NO_ALASKANS);
}
// etc...

List records = Lists.newArrayList(Iterables.filter(source, Predicates.and(preds)));

This does what you'd expect it to do.
Otherwise, at the end you'd have to manually check to see that your predicates are empty and either not filter or pass a Predicates.alwaysTrue() instead of your anded predicates.