Mediator Pattern is one of the behavioral design pattern, so it deals with the behaviors of objects. Mediator design pattern…