Bouncer Pattern

The Bouncer Pattern describes usage of =
a method whose sole purpose is to either throw an exception (when particula=
r conditions hold) or do nothing. Such methods are often used to defensivel=
y guard pre-conditions of a method.

=20

When writing utility methods, you should always guard against faulty inp=
ut arguments. When writing internal methods, you may be able to ensure that=
certain pre-conditions always hold by having sufficient unit tests in plac=
e. Under such circumstances, you may reduce the desirability to have guards=
on your methods.

=20

Groovy differs from other languages in that you frequently use the assert method within your methods rather than having a large number=
of utility checker methods or classes.