public MethodSpec getMethodSpec() {
        return methodNeedsInjection()
                ? new MethodSpecGenerator(
                                uniqueMethodName,
                                BeforeAll.class,
                                Modifier.STATIC,
                                defaultParameterSpecsForEachUnitTest(),
                                generateStatementBody())
                        .generate()
                : new MethodSpecGenerator(uniqueMethodName, generateStatementBody()).generate();
    }
@Test
    public void testThatDeployMethodWasGenerated() {

        Optional<Method> deployMethod =
                filteredMethods.stream().filter(m -> m.getName().equals("deploy")).findAny();
        MethodSpec deployMethodSpec =
                new MethodParser(deployMethod.get(), greeterContractClass, "deploy")
                        .getMethodSpec();
        assertEquals(
                "@org.junit.jupiter.api.BeforeAll\n"
                        + "static void deploy(org.web3j.protocol.Web3j web3j,\n"
                        + "    org.web3j.tx.TransactionManager transactionManager,\n"
                        + "    org.web3j.tx.gas.ContractGasProvider contractGasProvider) throws java.lang.Exception {\n"
                        + "  greeter = org.web3j.test.contract.Greeter.deploy(web3j, transactionManager, contractGasProvider, \"REPLACE_ME\").send();\n"
                        + "}\n",
                deployMethodSpec.toString());
    }