@Test
public void testBuildFunctionConstantSingleValueRawListReturn() throws Exception {

    AbiDefinition functionDefinition = new AbiDefinition(
            true,
            Arrays.asList(
                new AbiDefinition.NamedType("param", "uint8")),
            "functionName",
            Arrays.asList(
                    new AbiDefinition.NamedType("result", "address[]")),
            "type",
            false);
    MethodSpec methodSpec = solidityFunctionWrapper.buildFunction(functionDefinition);
    //CHECKSTYLE:OFF
    String expected =
            "public org.web3j.protocol.core.RemoteCall<java.util.List> functionName(java.math.BigInteger param) {\n"
            + "  final com.peersafe.abi.datatypes.Function function = new com.peersafe.abi.datatypes.Function(FUNC_FUNCTIONNAME, \n"
            + "      java.util.Arrays.<com.peersafe.abi.datatypes.Type>asList(new com.peersafe.abi.datatypes.generated.Uint8(param)), \n"
            + "      java.util.Arrays.<com.peersafe.abi.TypeReference<?>>asList(new com.peersafe.abi.TypeReference<com.peersafe.abi.datatypes.DynamicArray<com.peersafe.abi.datatypes.Address>>() {}));\n"
            + "  return new org.web3j.protocol.core.RemoteCall<java.util.List>(\n"
            + "      new java.util.concurrent.Callable<java.util.List>() {\n"
            + "        @java.lang.Override\n"
            + "        @java.lang.SuppressWarnings(\"unchecked\")\n"
            + "        public java.util.List call() throws java.lang.Exception {\n"
            + "          java.util.List<com.peersafe.abi.datatypes.Type> result = (java.util.List<com.peersafe.abi.datatypes.Type>) executeCallSingleValueReturn(function, java.util.List.class);\n"
            + "          return convertToNative(result);\n"
            + "        }\n"
            + "      });\n"
            + "}\n";
    //CHECKSTYLE:ON
    assertThat(methodSpec.toString(), is(expected));
}