This makes the information if Assertions are enabled accessible in the program.
If assertions are disabled (this is the default) the assertion statement will not be executet, and mybool will have the value false.
if assertions are enabled (jvm argument -ea) the assertion will get executed, and by a side effect mybool will be set to true.
You can use that to enforce enabling or disabling of assertions. For example I have a Test in my TestSuites that failes if assertions are not enabled, in order to enforce that the assertions are always on when running the tests.