SWE 619 Assignment 11
Fall 2023


Goal: Favoring composition over inheritance. Bloch, Item 18.

Consider the InstrumentedSet example from Bloch Item 18 (as well as in-class exercise #10A).

  1. Replace Set (globally) with List. There is no problem with equals(). Why not?
  2. Replace Set (globally) with Collection. Now equals() does not satisfy its contract.

The GTA will look for correct responses, appropriate JUnit tests, and plausible explanations when doing the grading.