Slide 64
Slide 64 text
List states = Lists.newArrayList(
new State("MT", false),
new State("ID", false),
new State("WY", false),
new State("SD", false),
new State("NE", false),
new State("WI", false),
new State("IN", false),
new State("TX", false),
new State("CA", true),
new State("AZ", true),
new State("NM", true),
new State("AR", true),
new State("IL", true),
new State("IA", true));
Predicate withI = state -> state.getAbbreviation().startsWith("I");
Predicate isExpanded = state -> state.isExpanded();
Collection filtered = filter(states, or(withI, not(isExpanded)));