title: Debugging in Java with preconditions
body: <p>Working with Chromium codebase I got used to macros like <code>CHECK(condition);</code>, <code>DCHECK(contidtion)</code> and <code>NOTREACHED;</code>. They introduce assertions (usually preconditions) to the code and allow to terminate program with some info in a log, an in debug build <code>DCHECK</code> and <code>NOTREACHED</code> would also stop debugger to investigate the case. First one is active only in release mode and latter two only in debug - when "unactive" they would be replaced by an empty macro and not cause any overhead.</p>
  
  <p>Is there some library in Java that allows such thing? I know that I could create some static method/object and depending on configuration swap configuration but I cannot see the way to avoid creating overhead. Besides, I wouldn't want to reinvent the wheel.</p>