### Question:
ConsoleLoggerBuilder { public ConsoleLogger build() { return consoleLoggerFactory.apply(messageConsumers.build()); } @VisibleForTesting  ConsoleLoggerBuilder(ConsoleLoggerFactory consoleLoggerFactory); static ConsoleLoggerBuilder rich(
      SingleThreadedExecutor singleThreadedExecutor, boolean enableTwoCursorUpJump); static ConsoleLoggerBuilder plain(SingleThreadedExecutor singleThreadedExecutor); ConsoleLoggerBuilder lifecycle(Consumer<String> messageConsumer); ConsoleLoggerBuilder progress(Consumer<String> messageConsumer); ConsoleLoggerBuilder debug(Consumer<String> messageConsumer); ConsoleLoggerBuilder error(Consumer<String> messageConsumer); ConsoleLoggerBuilder info(Consumer<String> messageConsumer); ConsoleLoggerBuilder warn(Consumer<String> messageConsumer); ConsoleLogger build();  }### Answer:
@Test public void testBuild() { List<String> messages = new ArrayList<>(); List<Level> levels = new ArrayList<>(); ConsoleLoggerFactory consoleLoggerFactory = messageConsumers -> { Assert.assertEquals( ImmutableMap.builder() .put(Level.LIFECYCLE, mockLifecycleConsumer) .put(Level.PROGRESS, mockProgressConsumer) .put(Level.INFO, mockInfoConsumer) .put(Level.DEBUG, mockDebugConsumer) .put(Level.WARN, mockWarnConsumer) .put(Level.ERROR, mockErrorConsumer) .build(), messageConsumers); return new ConsoleLogger() { @Override public void log(Level logLevel, String message) { messages.add(message); levels.add(logLevel); } @Override public void setFooter(List<String> footerLines) { } }; }; ConsoleLogger consoleLogger = new ConsoleLoggerBuilder(consoleLoggerFactory) .lifecycle(mockLifecycleConsumer) .progress(mockProgressConsumer) .info(mockInfoConsumer) .debug(mockDebugConsumer) .warn(mockWarnConsumer) .error(mockErrorConsumer) .build(); consoleLogger.log(Level.LIFECYCLE, "lifecycle"); consoleLogger.log(Level.PROGRESS, "progress"); consoleLogger.log(Level.INFO, "info"); consoleLogger.log(Level.DEBUG, "debug"); consoleLogger.log(Level.WARN, "warn"); consoleLogger.log(Level.ERROR, "error"); Assert.assertEquals( Arrays.asList( Level.LIFECYCLE, Level.PROGRESS, Level.INFO, Level.DEBUG, Level.WARN, Level.ERROR), levels); Assert.assertEquals( Arrays.asList("lifecycle", "progress", "info", "debug", "warn", "error"), messages); }