Code examples for chapter four: Patterns for Testing Reactive Systems