code: private void setAccountId(CloudTrailEventData eventData) {
          if (eventData.getRecipientAccountId() != null) {
              eventData.add("accountId", eventData.getRecipientAccountId());
              return;
          }
  
          if (eventData.getUserIdentity() != null &&
              eventData.getUserIdentity().getAccountId() != null) {
              eventData.add("accountId", eventData.getUserIdentity().getAccountId());
              return;
          }
  
          if (eventData.getUserIdentity() != null &&
              eventData.getUserIdentity().getAccountId() == null &&
              eventData.getUserIdentity().getSessionContext() != null &&
              eventData.getUserIdentity().getSessionContext().getSessionIssuer() != null &&
              eventData.getUserIdentity().getSessionContext().getSessionIssuer().getAccountId() != null) {
              eventData.add("accountId", eventData.getUserIdentity().getSessionContext().getSessionIssuer().getAccountId());
          }
      }
docs: Set AccountId in CloudTrailEventData top level from either recipientAccountID or from UserIdentity.
  If recipientAccountID exists then recipientAccountID is set to accountID; otherwise, accountID is retrieved
  from UserIdentity.
  
  There are 2 places accountID would appear in UserIdentity: first is the UserIdentity top level filed
  and the second place is accountID inside SessionIssuer. If accountID exists in the top level field, then it is
  set to accountID; otherwise, accountID is retrieved from SessionIssuer.
  
  If all 3 places cannot find accountID, then accountID is not set.
  
  @param eventData the event data to set.