@Test
public void handleBinaryMessage() throws Exception {

  Message<String> message = new Message<>(0, 1L, 1, 1L, "a");
  BinaryMessage binaryMessage = new BinaryMessage((new ObjectMapper()).writeValueAsBytes(message));
  String refUtf8 = new String(binaryMessage.getPayload().array(), UTF_8);
  String refUtf16 = new String(binaryMessage.getPayload().array(), UTF_16);
  underTest.afterConnectionEstablished(session);
  underTest.handleBinaryMessage(session, binaryMessage);
  ArgumentCaptor<String> valueCapture = ArgumentCaptor.forClass(String.class);
  verify(service).onEvent(valueCapture.capture());
  String out = valueCapture.getValue();
  assertEquals(refUtf8, out);
  assertNotEquals(refUtf16, out);
}