private void testMessageWithOnlyFixedHeader(MqttMessageType messageType) throws Exception {
    MqttMessage message = createMessageWithFixedHeader(messageType);
    ByteBuf byteBuf = MqttEncoder.doEncode(ALLOCATOR, message);

    final List<Object> out = new LinkedList<>();
    mqttDecoder.decode(ctx, byteBuf, out);

    assertEquals("Expected one object bout got " + out.size(), 1, out.size());

    final MqttMessage decodedMessage = (MqttMessage) out.get(0);
    validateFixedHeaders(message.fixedHeader(), decodedMessage.fixedHeader());
  }
  @Test
  public void testConnAckMessage() throws Exception {
    final MqttConnAckMessage message = createConnAckMessage();
    ByteBuf byteBuf = MqttEncoder.doEncode(ALLOCATOR, message);

    final List<Object> out = new LinkedList<>();
    mqttDecoder.decode(ctx, byteBuf, out);

    assertEquals("Expected one object bout got " + out.size(), 1, out.size());

    final MqttConnAckMessage decodedMessage = (MqttConnAckMessage) out.get(0);
    validateFixedHeaders(message.fixedHeader(), decodedMessage.fixedHeader());
    validateConnAckVariableHeader(message.variableHeader(), decodedMessage.variableHeader());
  }