I get this error when trying to compile:
The method filter(Iterable<T>, Predicate<? super T>) in the type Iterables is not applicable for the arguments (Iterator<PeopleSoftBalance>, ColumnLikePredicate<PeopleSoftBalance>)
Here is the ColumnLikePredicate class sig:
public class ColumnLikePredicate<T extends RowModel> implements Predicate<T>
What am I doing wrong?
Sounds like you are passing an
Iteratorto a method that expects anIterable.Iterator:
Iterable:
Iteratoris an object that can be used to iterate over a (different) collection.Iterableis an object that can be iterated over.I would guess that you have some sort of
collectionand you are calling something likeIterables.filter(collection.iterator(), predicate). TheIterablesclass wants you to pass the Iterable itself, like: