Posted: January 7th, 2022
Consider the remove() method from the Java Iterator
interface. The remove() method has a complex precondition on the
state of the Iterator, and the programmer can choose to detect
violations of the precondition and report them as
IllegalStateException.
(a) Formalize the precondition.
(b) Find (or write) an implementation of an Iterator. The Java
Collection classes are a good place to search.
(c) Develop and run CACC tests on the implementation.
Place an order in 3 easy steps. Takes less than 5 mins.