Consider Liskov's IntSet example (implemented in
LiskovSet.java)
// Overview: IntSets are mutable, unbounded sets of integers
List<Integer> els; // the representation

What is the abstraction function?

What is an appropriate repinvariant?

How do generics help?

How do AF/RI change for a specialized rep:
public class IntSet {
// IntSets are mutable, unbounded sets of integers
boolean[] specialEls = new boolean[10]; // frequent items
List<Integer> otherEls; // infrequent items

Consider the mutable
GrowList
example
(implemented in
GrowList.java)
from the homework.
This code uses a map to represent a list.
What is the abstraction function?
What is a suitable representation invariant?
What happens if you add a
public void nasty() {
}
method to the interface that breaks the representation invariant?