code: public boolean putAtomic(C instance, K key, V value, Map<K, V> snapshot) {
          Assert.checkNotNullParam("key", key);
          final Map<K, V> newMap;
          final int oldSize = snapshot.size();
          if (oldSize == 0) {
              newMap = Collections.singletonMap(key, value);
          } else if (oldSize == 1) {
              final Map.Entry<K, V> entry = snapshot.entrySet().iterator().next();
              final K oldKey = entry.getKey();
              if (oldKey.equals(key)) {
                  return false;
              } else {
                  newMap = new FastCopyHashMap<K, V>(snapshot);
                  newMap.put(key, value);
              }
          } else {
              newMap = new FastCopyHashMap<K, V>(snapshot);
              newMap.put(key, value);
          }
          return updater.compareAndSet(instance, snapshot, newMap);
      }
docs: Put a value if and only if the map has not changed since the given snapshot was taken. If the put fails,
  it is the caller's responsibility to retry.
  
  @param instance the instance with the map field
  @param key the key
  @param value the value
  @param snapshot the map snapshot
  @return {@code false} if the snapshot is out of date and we could not update, {@code true} if the put succeeded