public static List<Type> decode(String rawInput, List<TypeReference<Type>> outputParameters) {
        return decoder.decodeFunctionResult(rawInput, outputParameters);
    }
@Test
    public void testBuildDynamicArrayOfStaticStruct() throws ClassNotFoundException {
        // This is a version of testDecodeStaticStructDynamicArray() that builds
        // the decoding TypeReferences using inner types.
        String rawInput =
                "0x0000000000000000000000000000000000000000000000000000000000000020"
                        + "0000000000000000000000000000000000000000000000000000000000000002"
                        + "000000000000000000000000000000000000000000000000000000000000007b"
                        + "000000000000000000000000000000000000000000000000000000000000007b"
                        + "000000000000000000000000000000000000000000000000000000000000007b"
                        + "000000000000000000000000000000000000000000000000000000000000007b";

        // (uint256, uint256) static struct.
        TypeReference<StaticStruct> staticStructTr =
                new TypeReference<StaticStruct>(
                        false,
                        Arrays.asList(
                                TypeReference.makeTypeReference("uint256"),
                                TypeReference.makeTypeReference("uint256"))) {};

        // (uint256, uint256)[] dynamic array of static struct.
        TypeReference<DynamicArray> dynamicArray =
                new TypeReference<DynamicArray>(false) {
                    @Override
                    public TypeReference getSubTypeReference() {
                        return staticStructTr;
                    }

                    @Override
                    public java.lang.reflect.Type getType() {
                        return new java.lang.reflect.ParameterizedType() {
                            @Override
                            public java.lang.reflect.Type[] getActualTypeArguments() {
                                return new java.lang.reflect.Type[] {staticStructTr.getType()};
                            }

                            @Override
                            public java.lang.reflect.Type getRawType() {
                                return DynamicArray.class;
                            }

                            @Override
                            public java.lang.reflect.Type getOwnerType() {
                                return Class.class;
                            }
                        };
                    }
                };

        List<Type> decodedData =
                FunctionReturnDecoder.decode(rawInput, Utils.convert(Arrays.asList(dynamicArray)));

        List<Type> decodedArray = ((DynamicArray) decodedData.get(0)).getValue();

        List<Type> decodedStaticStruct0 = ((StaticStruct) decodedArray.get(0)).getValue();
        assertEquals(decodedStaticStruct0.get(0).getValue(), BigInteger.valueOf(123));
        assertEquals(decodedStaticStruct0.get(1).getValue(), BigInteger.valueOf(123));

        List<Type> decodedStaticStruct1 = ((StaticStruct) decodedArray.get(1)).getValue();
        assertEquals(decodedStaticStruct1.get(0).getValue(), BigInteger.valueOf(123));
        assertEquals(decodedStaticStruct1.get(1).getValue(), BigInteger.valueOf(123));
    }