ConsoleImpl extends Composite implements Console { @Override public void printWarn(@NotNull String line) { MessageBuilder messageBuilder = messageBuilderProvider.get() .type(WARNING) .message(WARNING.getPrefix() + ' ' + line); print(messageBuilder.build()); } @Inject  ConsoleImpl(RunnerResources resources,
                       Provider<MessageBuilder> messageBuilderProvider,
                       WidgetFactory widgetFactory,
                       @NotNull @Assisted Runner runner); @Override void print(@NotNull String text); @Override void printInfo(@NotNull String line); @Override void printError(@NotNull String line); @Override void printWarn(@NotNull String line); @Override void scrollBottom(); @Override void clear(); @Override void changeWrapTextParam(); @Override boolean isWrapText();  }
@Test public void warningMessageShouldBePrinted() throws Exception { console.printWarn(SOME_TEXT); verify(console.output).add(any(HTML.class)); verify(messageBuilder).type(WARNING); verify(messageBuilder).message(WARNING.getPrefix() + ' ' + SOME_TEXT); }