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
Your tests should include exceptions as well as normal values.
Note that there is a typo on the signature for
public boolean checker (Integer i)You may want to make the
Checkclass generic as well, in which case the
checkermethod would also have a generic parameter.
As an example of how this code works, the
method might select for even integers.
If the Iterator
g were from a
with the values
[0, 1, 2, 3]
would produce exactly two values on
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.
remove() method should be coded to produce
next(), hasNext()methods correctly implemented.
removemethod correctly implemented.