Make the state flag test use a Predicate for membership testing.