Contracts for Java enables you to annotate your code with contracts in the form of preconditions, postconditions and invariants.