@Test
public void testSize2Varint() {

    final int size = 2;
    final int num = 266;
    assertThat(ProtobufVarint32LengthFieldPrepender.computeRawVarint32Size(num), is(size));
    final byte[] buf = new byte[size + num];
    /**
     * 8    A    0    2
     * 1000 1010 0000 0010
     * 0000 1010 0000 0010
     * 0000 0010 0000 1010
     *  000 0010  000 1010
     *
     *  0000 0001 0000 1010
     *  0    1    0    A
     * 266
     */
    buf[0] = (byte) (0x8A & 0xFF);
    buf[1] = 0x02;
    for (int i = size; i < num + size; ++i) {
        buf[i] = 1;
    }
    assertTrue(ch.writeOutbound(wrappedBuffer(buf, size, buf.length - size)));
    ByteBuf expected = wrappedBuffer(buf);
    ByteBuf actual = ch.readOutbound();
    assertThat(actual, is(expected));
    assertFalse(ch.finish());
    expected.release();
    actual.release();
}