SWE 619 Assignment 11
Fall 2017

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

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

  1. Replace sets with collections. equals() no longer satisfies its contract.
  2. Now consider the example: In either case, is there a problem with equals()? If so, give a JUnit test. If not, why not? If you're not sure, simply run the code.

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