@Test
public void testBuildFunctionTransaction() throws Exception {

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