}
@Override
public <P> int countWith(final Predicate2<? super T, ? super P> predicate, final P parameter)
{
final Counter result = new Counter();
this.forEachWithOccurrences(new ObjectIntProcedure<T>()
{
public void value(T each, int occurrences)
{
if (predicate.accept(each, parameter))
{
result.add(occurrences);
}
}
});
return result.getCount();
}