void main(String[] arguments) throws Exception { if (arguments.length != 2) { IO.println("Usage: java Mediator.java "); return; } var from = arguments[0]; var to = arguments[1]; IO.println("Mediating: " + from + " -> " + to); FileMessageBoard.watch(from, message -> { try { FileMessageBoard.publish(to, message); } catch (IOException exception) { throw new UncheckedIOException(exception); } }); }