@Test
public void dataFramesShouldMergeUseVoidPromise() throws Exception {

    createStream(STREAM_ID, false);
    final ByteBuf data = dummyData().retain();
    ChannelPromise promise1 = newVoidPromise(channel);
    encoder.writeData(ctx, STREAM_ID, data, 0, true, promise1);
    ChannelPromise promise2 = newVoidPromise(channel);
    encoder.writeData(ctx, STREAM_ID, data, 0, true, promise2);
    // Now merge the two payloads.
    List<FlowControlled> capturedWrites = payloadCaptor.getAllValues();
    FlowControlled mergedPayload = capturedWrites.get(0);
    mergedPayload.merge(ctx, capturedWrites.get(1));
    assertEquals(16, mergedPayload.size());
    assertFalse(promise1.isSuccess());
    assertFalse(promise2.isSuccess());
    // Write the merged payloads and verify it was written correctly.
    mergedPayload.write(ctx, 16);
    assertEquals(0, mergedPayload.size());
    assertEquals("abcdefghabcdefgh", writtenData.get(0));
    assertEquals(0, data.refCnt());
    // The promises won't be set since there are no listeners.
    assertFalse(promise1.isSuccess());
    assertFalse(promise2.isSuccess());
}