Some people were asking how they can enable assertions in Netbeans.Here is the simple answer.
In the command line execution you can add the argument -ea (enable assertions) to the run command like : java -ea myApp.java
Right click on your project name and select properties,
Click Run in the leftside panel
Then, in the right, write -ea in the input box beside VM Options, Then you are done.
This is the same way you can add any runtime parameters to netbeans