code: private Address chooseTargetReplica(List<Address> excludedAddresses) {
          final List<Address> replicaAddresses = getReplicaAddresses(excludedAddresses);
          if (replicaAddresses.isEmpty()) {
              return null;
          }
  
          final Address localAddress = getNodeEngine().getLocalMember().getAddress();
          if (replicaAddresses.contains(localAddress)) {
              return localAddress;
          }
          final int randomReplicaIndex = ThreadLocalRandomProvider.get().nextInt(replicaAddresses.size());
          return replicaAddresses.get(randomReplicaIndex);
      }
docs: Chooses and returns a CRDT replica address. Replicas with addresses
  contained in the {@code excludedAddresses} list are excluded.
  The method may return {@code null} if there are no viable addresses.
  If the local address is a possible replica, it returns the local address,
  otherwise it chooses a replica randomly.
  
  @param excludedAddresses the addresses to exclude when choosing a replica address
  @return a CRDT replica address or {@code null} if there are no viable addresses