@Test
public void testDynamicArray() {

    assertThat(TypeDecoder.decodeDynamicArray(
            "0000000000000000000000000000000000000000000000000000000000000000",  // length
            0,
            new TypeReference<DynamicArray<Uint256>>() { }
            ),
            equalTo(DynamicArray.empty("uint256")));
    assertThat(TypeDecoder.decodeDynamicArray(
            "0000000000000000000000000000000000000000000000000000000000000002"  // length
                    + "000000000000000000000000000000000000000000000000000000000000000a"
                    + "0000000000000000000000000000000000000000000000007fffffffffffffff",
            0,
            new TypeReference<DynamicArray<Uint256>>() { }
            ),
            equalTo(new DynamicArray<Uint256>(
                    new Uint256(BigInteger.TEN),
                    new Uint256(BigInteger.valueOf(Long.MAX_VALUE)))));
    assertThat(TypeDecoder.decodeDynamicArray(
            "0000000000000000000000000000000000000000000000000000000000000002"  // length
                    + "000000000000000000000000000000000000000000000000000000000000000d"
                    + "48656c6c6f2c20776f726c642100000000000000000000000000000000000000"
                    + "000000000000000000000000000000000000000000000000000000000000000d"
                    + "776f726c64212048656c6c6f2c00000000000000000000000000000000000000",
            0,
            new TypeReference<DynamicArray<Utf8String>>() { }
            ),
            equalTo(new DynamicArray<Utf8String>(
                    new Utf8String("Hello, world!"),
                    new Utf8String("world! Hello,"))));
}