Hi Group,
I am working on project to use cofoja to write contracts and I am stuck at place where I have to check if list is null or have null reference and no in world I can write pre condition for that.
This is my method:
@Requires("n != null")
public void push(Object o) {
numbers.add(o);
}
This is my test to check if I vioalte precondition
@Test
public void PushFailTest () {
assertThrows(PreconditionError.class, () -> {
list.push(null);
});
}