Develop a generic collection-class BinarySearchTree. Implement three ways of traversing a tree:
- preorder,
- inorder,
- postorder.
Suggest different ways (2-3 ways) of the description of the class TrafficLight (Traffic Lights) for the control system of various traffic lights, corresponding to the principles of OOP.