public int capacity()
    {
        return capacity;
    }
@Test
    void shouldThrowExceptionForCapacityThatIsNotPowerOfTwo()
    {
        final int capacity = 777;
        final int totalBufferLength = capacity + BroadcastBufferDescriptor.TRAILER_LENGTH;

        when(buffer.capacity()).thenReturn(totalBufferLength);

        assertThrows(IllegalStateException.class, () -> new BroadcastTransmitter(buffer));
    }