The constructor of the Sentence class below makes assumptions about the text parameter:
new Sentence("Mary had a little lamb.")
is ok, but
new Sentence("Mary had a little lamb")
new Sentence("Mary had a little lamb!")
You should add assert statements to the constructor that check for these preconditions.
The check method uses exception handling, a technique introduced in Chapter 11 of the text, to check that you inserted the appropriate assert statements. You need not understand the implementation of the check method at this time, and you should not modify it.