O'Reilly logo
  • You Wang thinks this is interesting:

The assertion mechanism allows you to put in checks during testing and to have them automatically removed in the production code.

From

Cover of Core Java® Volume I—Fundamentals, Tenth Edition

Note

exception is for production code, assertion is for development code