C4J: Design by Contract framework for Java 1.5
Contracts for Java (C4J) is a Design By Contract framework for Java 1.5 and later.
Adding class invariants, pre conditions, and post conditions to your regular Java objects is easy with C4J. Contracts for a class (the target) are implemented in a separate class (the contract). The contract is linked to the target at compile time using an annotation, and the actual contract verification code is tied to the target using instrumentation during class loading at run time.
link






