And this solution, we're going to quality control the manager class, almost every bad invocation of
a method or constructor is because the caller passed an illegal arguments or called the method that
about time.
So looking at the code, I can't think of any illegal arguments the user may pass that haven't been
accounted for because the constructor doesn't receive any parameters.
So there's nothing to really check and hear.
If the user passes a null instead of an actual object, the code would already throw a null pointer
exception.
So throwing in a legal argument exception would be redundant.
The same argument can be made for ad contact and remove contact.
What about illegal state exceptions?
Remember that illegal exceptions occur when an object calls its method at a bad time.
What about ad contact?
If there was a maximum number of contacts that you can store, then you could throw an illegal state
exception for that particular scenario.
But if you were to go back and read the requirements, there is no limit to the number of contacts that
you can add.
Although an object would not be in a valid state to call or remove contact if the Israelis, it is empty,
if there are no contacts to remove now, array lists have an empty method that returns true if it has
no elements.
So we'll check if contact.
That is empty.
And in such a case will throw a new illegal -- exception.
You can't call the remove method if there are no contacts to remove.
OK, I can't think of any more safety checks that we need to apply so we can wrap up right here.