How to programmatically test if assertions are enabled?
I guess you should use Class.desiredAssertionStatus()
http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html#desiredAssertionStatus()
I use this
boolean assertOn = false;
// *assigns* true if assertions are on.
assert assertOn = true;
I am not sure this is the "official" way.