Added method printMessages(Consumer<String>) to MessageCollector.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>