MessagerLogger implements Logger { @Override public void warning(@Nonnull String message, @Nullable Object... args) { print(Diagnostic.Kind.WARNING, message, args); } @Inject @SuppressWarnings("unused")  MessagerLogger(@Nonnull Messager messager); @VisibleForTesting  MessagerLogger(@Nonnull Messager messager, @Nonnull Locale locale); @Override void warning(@Nonnull String message, @Nullable Object... args); @Override void error(@Nonnull String message, @Nullable Object... args);  }
@Test public void warningShouldPrintMessageWithWarning() { underTest.warning("This is %s message", "warning"); verify(messager) .printMessage(eq(Diagnostic.Kind.WARNING), eq("This is warning message")); }