//Associate a token to an account
TokenAssociateTransaction transaction = new TokenAssociateTransaction()
.setTokenIds(Collections.singletonList(tokenId));
//Freeze the unsigned transaction, sign with the private key of the account that is being associated to a token, submit the transaction to a Hedera network
TransactionResponse txResponse = transaction.freezeWith(client).sign(accountKey).execute(client);
//Request the receipt of the transaction
TransactionReceipt receipt = txResponse.getReceipt(client);
//Get the transaction consensus status
Status transactionStatus = receipt.status;
System.out.println("The transaction consensus status " +transactionStatus);