extract out code to construct negative test constraint