public class FilterTester
{
public static void main(String[] args)
{
ArrayList<String> list = new ArrayList<String>();
list.add("one");
list.add("two");
list.add("three");
list.add("four");
list.add("five");
list.add("six");
list.add("seven");
ArrayList<String> newList = filter(list, new StringFilter());
System.out.println(newList); // should display [one, two, six]
}
public static ArrayList<String> filter(ArrayList<String> a, Filter f)
{
...
}
}
Complete the filter method using a list iterator.