@Test
public void testMetadata() {

  LogData data =
      FakeLogData.withPrintfStyle("Foo='%s'", "bar")
          .addMetadata(COUNT_KEY, 23)
          .addMetadata(ID_KEY, "test ID");
  SimpleLogEvent logEvent = newSimpleLogEvent(data);
  assertThat(logEvent.asLoggingEvent().getMessage())
      .isEqualTo("Foo='bar' [CONTEXT count=23 id=\"test ID\" ]");
}