Assertions are typically enabled during testing but disabled during deployment.
Assertions are disabled at runtime by default.
To enable them, use a command-line flag -ea or -enableassertions.
Selectively disable assertions by using the -da or -disableassertions flag.
You can enable and disable assertions on a class-by-class basis, using the following syntax:
java -ea -da:MyClass TestClass