@Override
    public String getTypeAsString() {
        String type;
        // Handle dynamic array of zero length. This will fail if the dynamic array
        // is an array of structs.
        if (value.isEmpty()) {
            if (StructType.class.isAssignableFrom(getComponentType())) {
                type = Utils.getStructType(getComponentType());
            } else {
                type = AbiTypes.getTypeAString(getComponentType());
            }
        } else {
            if (StructType.class.isAssignableFrom(value.get(0).getClass())) {
                type = value.get(0).getTypeAsString();
            } else {
                type = AbiTypes.getTypeAString(getComponentType());
            }
        }
        return type + "[]";
    }
@Test
    public void testDynamicArrayWithDynamicStruct() {
        final List<DynamicStruct> list = Collections.singletonList(new DynamicStruct());
        final DynamicArray<DynamicStruct> array = new DynamicArray<>(DynamicStruct.class, list);

        assertEquals("()[]", array.getTypeAsString());
    }