Using interfaces with a traffic light system

Consider the typical traffic light system, which is used everywhere around the world to maintain traffic regulations. Every country has its own traffic rules, such as driving on the left or right side of the road. Even though traffic rules differ from country to country, there are certain rules that apply globally and need to be followed by every country. One such rule is the use of traffic lights to govern the traffic flow, where a red light is an indication to stop, an amber/yellow light to ready your engine, and a green light to move your vehicle. Let's say that these global rules are imposed by a central traffic authority, and we want to implement, for example, the Australian traffic system. ...

Get Hands-On Automation Testing with Java for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.