/*
   * Sends two messages and asserts they arrive as expected on the other side using
   * the supplied decoder.
   */
  protected void doTest(AbstractByteArraySerializer decoder) throws Exception {
    server.setDecoder(decoder);
    Message<String> message = new GenericMessage<>("foo");
    assertTrue(channels.input().send(message));
    String received = server.queue.poll(10, TimeUnit.SECONDS);
    assertEquals("foo", received);

    assertTrue(channels.input().send(message));
    received = server.queue.poll(10, TimeUnit.SECONDS);
    assertEquals("foo", received);
  }
 @AfterClass
 public static void shutDown() {
   server.shutDown();
 }