@Test
public void samePriorityShouldDistributeBasedOnData() throws Http2Exception {

    // Root the streams at the connection with the same weights.
    setPriority(STREAM_A, 0, DEFAULT_PRIORITY_WEIGHT, false);
    setPriority(STREAM_B, 0, DEFAULT_PRIORITY_WEIGHT, false);
    setPriority(STREAM_C, 0, DEFAULT_PRIORITY_WEIGHT, false);
    setPriority(STREAM_D, 0, DEFAULT_PRIORITY_WEIGHT, false);
    updateStream(STREAM_A, 400, true);
    updateStream(STREAM_B, 500, true);
    updateStream(STREAM_C, 0, true);
    updateStream(STREAM_D, 700, true);
    // Set allocation quantum to 1 so it is easier to see the ratio of total bytes written between each stream.
    distributor.allocationQuantum(1);
    assertTrue(write(999));
    assertEquals(333, captureWrites(STREAM_A));
    assertEquals(333, captureWrites(STREAM_B));
    verifyWrite(times(1), STREAM_C, 0);
    assertEquals(333, captureWrites(STREAM_D));
}