Copied! Here is the similar instance I used in an before section to discuss purpose composition. It generally allows for substituting print() which has a personalized perform of the exact same interface. To check if it prints the appropriate message, you have to intercept it by injecting a mocked operate: https://social40.com/story3964493/the-smart-trick-of-hpe-printer-that-nobody-is-discussing