code: public void alias(final @NonNull String newId, final @Nullable Options options) {
      assertNotShutdown();
      if (isNullOrEmpty(newId)) {
        throw new IllegalArgumentException("newId must not be null or empty.");
      }
  
      analyticsExecutor.submit(
          new Runnable() {
            @Override
            public void run() {
              final Options finalOptions;
              if (options == null) {
                finalOptions = defaultOptions;
              } else {
                finalOptions = options;
              }
  
              AliasPayload.Builder builder =
                  new AliasPayload.Builder()
                      .userId(newId)
                      .previousId(analyticsContext.traits().currentId());
              fillAndEnqueue(builder, finalOptions);
            }
          });
    }
docs: The alias method is used to merge two user identities, effectively connecting two sets of user
  data as one. This is an advanced method, but it is required to manage user identities
  successfully in some of our integrations.
  
  <p>Usage:
  
  <pre> <code>
  analytics.track("user did something");
  analytics.alias(newId);
  analytics.identify(newId);
  </code> </pre>
  
  @param newId The new ID you want to alias the existing ID to. The existing ID will be either
  the previousId if you have called identify, or the anonymous ID.
  @param options To configure the call
  @throws IllegalArgumentException if newId is null or empty
  @see <a href="https://segment.com/docs/tracking-api/alias/">Alias Documentation</a>