 <p>There is a nice overview on <a href="http://en.wikipedia.org/wiki/Design_by_contract" rel="nofollow noreferrer">WikiPedia about Design by Contract</a>, at the end there is a section regarding <a href="http://en.wikipedia.org/wiki/Design_by_contract#Languages_with_third-party_support" rel="nofollow noreferrer">languages with third party support libraries</a>, which includes a nice serie of Java libraries. Most of these Java libraries are based on Java Assertions. </p> <p>In the case you only need <a href="http://en.wikipedia.org/wiki/Precondition" rel="nofollow noreferrer">Precondition Checking</a> there is also a lightweight <a href="http://www.javapractices.com/topic/TopicAction.do?Id=5" rel="nofollow noreferrer">Validate Method Arguments</a> solution, at SourceForge under <a href="http://java-arg-val.sourceforge.net/introduction.html" rel="nofollow noreferrer">Java Argument Validation</a> (Plain Java implementation).</p> <p>Depending on your problem, maybe the <a href="http://oval.sourceforge.net/" rel="nofollow noreferrer">OVal</a> framework, for field/property Constraints validation is a good choice. This framework lets you place the Constraints in all kind of different forms (Annotations, POJO, XML). Create customer constraints through POJO or scripting languages (JavaScript, Groovy, BeanShell, OGNL, MVEL). And it also party implements <a href="http://en.wikipedia.org/wiki/Design_by_contract" rel="nofollow noreferrer">Programming by Contract</a>.</p>