Maybe see http://docs.oracle.com/javase/7/docs/technotes/guides/language/assert.html#enable-disable
Enabling and disabling claims
To include statements in different details, use -enableassertions or -ea . To disable claims in different details, use the -disableassertions or -da options. You specify granularity with the arguments that you provide to the switch :
- packageName ...
Enables or disables claims in the name of the package and any subpackages. - ...
Enables or disables claims in an unnamed package in the current working directory. - class name
Enables or disables statements in a named class
For example, the following command launches the BatTutor program, with approval only included in the package com.wombat.fruitbat and its subpackages:
java -ea:com.wombat.fruitbat... BatTutor
You can enable claims for all packages, and then disable them for some packages. Or else - disable for all packages, then enable only for some of them.
source share