Implement a public class method named compare
on a public class Comparison
that accepts two Object
arguments.
It should return 0 if both references are equal, 1 if both objects are equal, and -1 otherwise.
Either reference can be null
, so you'll need to handle those cases carefully!
You're challenge is to write tests for this problem described above.
Stuck? You may find these lessons helpful: