### Question:
Contract extends ManagedTransaction { protected static <T extends Contract> T deploy(Class<T> type, Web3j web3j, Credentials credentials, GasProvider contractGasProvider, String binary, String encodedConstructor, BigInteger value, long chainId) throws RuntimeException, TransactionException { try { Constructor<T> constructor = type.getDeclaredConstructor(String.class, Web3j.class, Credentials.class, GasProvider.class, Long.class); constructor.setAccessible(true); T contract = constructor.newInstance(null, web3j, credentials, contractGasProvider, chainId); return create(contract, binary, encodedConstructor, value); } catch (TransactionException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } } protected  Contract(String contractBinary, String contractAddress, Web3j web3j, TransactionManager transactionManager, GasProvider gasProvider, long chainId); protected  Contract(String contractBinary, String contractAddress, Web3j web3j, Credentials credentials, GasProvider gasProvider, long chainId); void setContractAddress(String contractAddress); String getContractAddress(); void setTransactionReceipt(TransactionReceipt transactionReceipt); String getContractBinary(); void setGasProvider(GasProvider gasProvider); boolean isValid(); Optional<TransactionReceipt> getTransactionReceipt(); void setDefaultBlockParameter(DefaultBlockParameter defaultBlockParameter); static RemoteCall<T> deployRemoteCall(Class<T> type, Web3j web3j, Credentials credentials,
            GasProvider contractGasProvider, String binary, String encodedConstructor, BigInteger value, long chainId); static RemoteCall<T> deployRemoteCall(Class<T> type, Web3j web3j, Credentials credentials,
            GasProvider contractGasProvider, String binary, String encodedConstructor, long chainId); static RemoteCall<T> deployRemoteCall(Class<T> type, Web3j web3j, TransactionManager transactionManager,
            GasProvider contractGasProvider, String binary, String encodedConstructor, BigInteger value, long chainId); static RemoteCall<T> deployRemoteCall(Class<T> type, Web3j web3j, TransactionManager transactionManager,
            GasProvider contractGasProvider, String binary, String encodedConstructor, long chainId); static EventValues staticExtractEventParameters(
            Event event, Log log, long chainId); final void setDeployedAddress(String networkId, String address); final String getDeployedAddress(String networkId); static final BigInteger GAS_LIMIT; static final String FUNC_DEPLOY; }### Answer:
@Test public void testDeploy() throws Exception { TransactionReceipt transactionReceipt = createTransactionReceipt(); Contract deployedContract = deployContract(transactionReceipt); assertThat(deployedContract.getContractAddress(), is(ADDRESS)); assertTrue(deployedContract.getTransactionReceipt().isPresent()); assertThat(deployedContract.getTransactionReceipt().get(), equalTo(transactionReceipt)); }