title: Is Groovy's assert a good idea for production code, unlike Java's assert?
body: <p>In Java it's known that using the <code>assert</code> keyword is usually a bad idea, as its behavior is dependant on the runtime enviornment (it doesn't do anything by default, unless the -enableassertion is passed to the java runtime).</p>
  
  <p>Is Groovy's assert different? Is it always executed in production code, and is it recommended to use in production code? (In Java you would use something like <a href="http://guava-libraries.googlecode.com/svn/tags/release03/javadoc/com/google/common/base/Preconditions.html" rel="noreferrer">Preconditions</a> instead)</p>
  
  <p>From my sanity tests it seems that by default <code>assert</code> works well without any flags, and that it's actually way more powerful than the Java keyword (see <a href="http://hamletdarcy.blogspot.com/2009/05/new-power-assertions-in-groovy.html" rel="noreferrer">Power Assert</a>) - I'm just looking for an official/complete answer, as opposed to my anecdotal one.</p>