Java transaction with the pure stake api error

import com.algorand.algosdk.account.Account;
import com.algorand.algosdk.v2.client.common.AlgodClient;
import com.algorand.algosdk.v2.client.model.PendingTransactionResponse;
import com.algorand.algosdk.v2.client.model.TransactionParametersResponse;
import com.algorand.algosdk.v2.client.model.PostTransactionsResponse;
import com.algorand.algosdk.transaction.SignedTransaction;
import com.algorand.algosdk.transaction.Transaction;
import com.algorand.algosdk.util.Encoder;
import org.apache.commons.lang3.ArrayUtils;

public class SubmitTx {
    // Function from Algorand Inc. - Utility function to wait on a transaction to be confirmed
    public static void waitForConfirmation(AlgodClient client, String txID, String[] headers, String[] values) throws Exception {
        Long lastRound = client.GetStatus().execute(headers, values).body().lastRound;
        while (true) {
            try {
                // Check the pending tranactions
                PendingTransactionResponse pendingInfo = client.PendingTransactionInformation(txID).execute(headers, values).body();
                if (pendingInfo.confirmedRound != null && pendingInfo.confirmedRound > 0) {
                    System.out.println("Transaction confirmed in round " + pendingInfo.confirmedRound);
                client.WaitForBlock(lastRound).execute(headers, values);
            } catch (Exception e) {
                throw (e);

    public static void main(String[] args) throws Exception {
        final String ALGOD_API_ADDR = "";
        final int  ALGOD_PORT = 443;
        final String ALGOD_API_TOKEN = "";

        String[] headers = {"X-API-Key"};
        String[] values = {"YOUR API KEY HERE"};

        AlgodClient client = new AlgodClient(ALGOD_API_ADDR, ALGOD_PORT, ALGOD_API_TOKEN);

        final String SRC_ACCOUNT = "YOUR MNEMONIC HERE"; 
        Account src = new Account(SRC_ACCOUNT);


        TransactionParametersResponse params = client.TransactionParams().execute(headers, values).body();
        Long amount = 10L;

        Transaction tx = Transaction.PaymentTransactionBuilder().sender(src.getAddress()).receiver(DEST_ADDR).amount(amount).suggestedParams(params).build();
        SignedTransaction signedTx = src.signTransaction(tx);

        // send the transaction to the network
        try {
            String[] txHeaders = ArrayUtils.add(headers, "Content-Type");
            String[] txValues = ArrayUtils.add(values, "application/x-binary");
            byte[] encodedTxBytes = Encoder.encodeToMsgPack(signedTx);
            PostTransactionsResponse txResponse = client.RawTransaction().rawtxn(encodedTxBytes).execute(txHeaders, txValues).body();
            System.out.println("Transaction sent with ID " + txResponse.txId);
            waitForConfirmation(client, txResponse.txId, headers, values);
        } catch (Exception e) {
            System.err.println("Exception when calling algod#rawTransaction: " + e);

In this coding:
I faced error:Exception when calling algod#rawTransaction: java.lang.NullPointerException: Cannot read field “txId” because “txResponse” is null

What I have to put in ALGOD_API_TOKEN, headers, value variable.Can anyone help me?

This is an example from the PureStake example repo, also linked from the developer website: