code: V put(K key, V value, boolean onlyIfAbsent) {
          checkNotNull(key);
          checkNotNull(value);
  
          final int weight = weigher.weightOf(key, value);
          final WeightedValue<V> weightedValue = new WeightedValue<V>(value,
                  weight);
          final Node node = new Node(key, weightedValue);
  
          for (; ; ) {
              final Node prior = data.putIfAbsent(node.key, node);
              if (prior == null) {
                  afterCompletion(new AddTask(node, weight));
                  return null;
              } else if (onlyIfAbsent) {
                  afterCompletion(new ReadTask(prior));
                  return prior.getValue();
              }
              for (; ; ) {
                  final WeightedValue<V> oldWeightedValue = prior.get();
                  if (!oldWeightedValue.isAlive()) {
                      break;
                  }
  
                  if (prior.compareAndSet(oldWeightedValue, weightedValue)) {
                      final int weightedDifference = weight
                              - oldWeightedValue.weight;
                      final Task task = (weightedDifference == 0) ? new ReadTask(
                              prior) : new UpdateTask(prior, weightedDifference);
                      afterCompletion(task);
                      return oldWeightedValue.value;
                  }
              }
          }
      }
docs: Adds a node to the list and the data store. If an existing node is found,
  then its value is updated if allowed.
  
  @param key          key with which the specified value is to be associated
  @param value        value to be associated with the specified key
  @param onlyIfAbsent a write is performed only if the key is not already associated
  with a value
  @return the prior value in the data store or null if no mapping was found