The Java Modeling Language (JML) is a behavioral interface specification language that can be used to specify the behavior of Java modules (as in design by contract -- DBC). It has many tools to do assertion checking, unit testing, etc. Java Modeling Language (JML) home is here.