@Test
public void encodeNonMessage() throws Exception {

  Event event = new Rebalance(singleton(0));
  String raw = "";
  doReturn(raw).when(encoder).encode(event);
  doReturn(raw).when(metrics).record(eq(ENCODE), argThat(new ArgMatcher<Supplier<String>>() {}));
  String result = underTest.encodeEvent(event);
  assertThat(result, is(raw));
  verify(metrics, never()).markMessage(anyLong());
  @SuppressWarnings("unchecked")
  ArgumentCaptor<Supplier<String>> captor = ArgumentCaptor.forClass(Supplier.class);
  verify(metrics).record(eq(ENCODE), captor.capture());
  assertThat(captor.getValue().get(), is(raw));
}