@Test
public void testBuildFunctionConstantSingleValueReturn() throws Exception {

    AbiDefinition functionDefinition = new AbiDefinition(
            true,
            Arrays.asList(
                    new AbiDefinition.NamedType("param", "uint8")),
            "functionName",
            Arrays.asList(
                    new AbiDefinition.NamedType("result", "int8")),
            "type",
            false);
    MethodSpec methodSpec = solidityFunctionWrapper.buildFunction(functionDefinition);
    //CHECKSTYLE:OFF
    String expected =
            "public org.web3j.protocol.core.RemoteCall<java.math.BigInteger> functionName(java.math.BigInteger param) {\n"
                    + "  final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(\"functionName\", \n"
                    + "      java.util.Arrays.<org.web3j.abi.datatypes.Type>asList(new org.web3j.abi.datatypes.generated.Uint8(param)), \n"
                    + "      java.util.Arrays.<org.web3j.abi.TypeReference<?>>asList(new org.web3j.abi.TypeReference<org.web3j.abi.datatypes.generated.Int8>() {}));\n"
                    + "  return executeRemoteCallSingleValueReturn(function, java.math.BigInteger.class);\n"
                    + "}\n";
    //CHECKSTYLE:ON
    assertThat(methodSpec.toString(), is(expected));
}