/* +----------------------------+ | AList | +----------------------------+ | boolean same(Obj that) | | boolean contains(Obj that) | +----------------------------+ | / \ --- | --------------------------- | | +-------------+ +---------------+ | MTList | | ConsList | +-------------+ +---------------+ +-------------+ +----| ISame fist | | | AList rest | | +---------------+ v +--------------------------+ | ISame | +--------------------------+ | boolean same(ISame that) | +--------------------------+ | / \ --- | -------------------- | | +--------------+ +--------------+ | Book | | Song | +--------------+ +--------------+ | String title | | String title | | String author| | int time | | int year | +--------------+ +--------------+ */ // to represent a list of objects. interface AList extends ISame{ // is this object the same as that object? boolean same(ISame that); // does this list contan the given object? boolean contains(ISame that); }