Consider the following:
import groovy.contracts.*
@Invariant({ speed >= 0 })
class Rocket {
int speed
boolean started = true
@Requires({ isStarted() && inc > 0 })
@Ensures ({ isStarted() && old.speed < speed })
int accelerate(int inc) { speed += inc }
}
Editor support for the condition expressions is pretty minimal.
