@Test
/** encode int */
public void testEncodeInt() {

    byte[] expected = {(byte) 0x80};
    byte[] data = encodeInt(0);
    assertArrayEquals(expected, data);
    assertEquals(0, RLP.decodeInt(data, 0));
    byte[] expected2 = {(byte) 0x78};
    data = encodeInt(120);
    assertArrayEquals(expected2, data);
    assertEquals(120, RLP.decodeInt(data, 0));
    byte[] expected3 = {(byte) 0x7F};
    data = encodeInt(127);
    assertArrayEquals(expected3, data);
    assertEquals(127, RLP.decodeInt(data, 0));
    assertEquals(256, RLP.decodeInt(RLP.encodeInt(256), 0));
    assertEquals(255, RLP.decodeInt(RLP.encodeInt(255), 0));
    assertEquals(127, RLP.decodeInt(RLP.encodeInt(127), 0));
    assertEquals(128, RLP.decodeInt(RLP.encodeInt(128), 0));
    data = RLP.encodeInt(1024);
    assertEquals(1024, RLP.decodeInt(data, 0));
    byte[] expected4 = {(byte) 0x82, (byte) 0x76, (byte) 0x5F};
    data = encodeInt(30303);
    assertArrayEquals(expected4, data);
    assertEquals(30303, RLP.decodeInt(data, 0));
    byte[] expected5 = {(byte) 0x82, (byte) 0x4E, (byte) 0xEA};
    data = encodeInt(20202);
    assertArrayEquals(expected5, data);
    assertEquals(20202, RLP.decodeInt(data, 0));
    byte[] expected6 = {(byte) 0x83, 1, 0, 0};
    data = encodeInt(65536);
    assertArrayEquals(expected6, data);
    assertEquals(65536, RLP.decodeInt(data, 0));
    byte[] expected8 = {(byte) 0x84, (byte) 0x7F, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
    data = encodeInt(Integer.MAX_VALUE);
    assertArrayEquals(expected8, data);
    assertEquals(Integer.MAX_VALUE, RLP.decodeInt(data, 0));
}