SWE/CS 332 Assignment 6
Due Wednesday, October 11, 2017


Goal: Iteration Abstraction

Liskov 6.6. You need to implement enough so that this runs. Use generics sufficiently so that your code compiles without warnings. (Note that the Java Iterator interface has a generic parameter.) Turn in several JUnit tests that use the filter(). Your tests should include exceptions as well as normal values.

Note that there is a typo on the signature for checker:

    public boolean checker (Integer i) 
You may want to make the Check class generic as well, in which case the checker method would also have a generic parameter.

As an example of how this code works, the checker method might select for even integers. If the Iterator g were from a List with the values [0, 1, 2, 3] the resulting Iterator would produce exactly two values on next() calls, namely 0, and 2. After the 2 was returned, hasNext() would return false.

You may assume that the Iterator g returns a (relatively small) finite number of values.

Your remove() method should be coded to produce UnsupportedOperationException.

Grading Criteria: