Assume that you want to build a copy of an ImmutableSet/List/Map object but filter out some of the original entries. One way to implem
ImmutableSet
List
Map
Look at Guava's Iterators
Specifically filter(Iterator unfiltered, Predicate predicate)
The result of Iterables.filter() is just a view over the data in myObject: the new list is only built by ImmutableList.copyOf() using the filtering iterator provided by the Iterable
Iterables.filter()
myObject
ImmutableList.copyOf()
Iterable