Definition: The command pattern encapsulates a request as an object, thereby letting you parameterize other objects with different requests, queue or log requests, and support undoable operations. Command public class LightOnCommand implements Command {
Light light;
public LightOnCommand(Light light) {…