By using Mediator pattern we can decouple the multiple objects that
interact with each other. With a Mediator object we can create
many-to-many relationships in multiple objects.
In JDK there are many places where Mediator design pattern is
used. Some of these are as follows:
java.util.Timer: schedule() methods in Timer class act as
Mediator between the clients and the TimerTask to be
scheduled.
java.util.concurrent.Executor.execute(): The execute()
method in an Executor class acts as a Mediator to execute
the different tasks.
java.util.concurrent.ExecutorService
java.lang.reflect.Method.invoke(): In Method class of
reflection package, invoke() method acts as a Mediator.
java.util.concurrent.ScheduledExecutorService: Here also
schedule() method and its variants are Mediator pattern
implementations.
https://www.digitalocean.com/community/tutorials/mediator-design-pattern-java