The constructor of the Sentence class below makes assumptions about the text parameter:

For example,

new Sentence("Mary had a little lamb.")

is ok, but

new Sentence("Mary had a little lamb")

and

new Sentence("Mary  had  a  little  lamb!")

are not.

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.