Mediator design pattern implemented in Java