code: public void put(@NonNull INDArray update) {
          try {
              lock.writeLock().lock();
  
              //if we're already in collapsed mode - we just insta-decompress
              if (collapsedMode.get()) {
                  val lastUpdateIndex = collapsedIndex.get();
                  val lastUpdate = updates.get(lastUpdateIndex);
  
                  Preconditions.checkArgument(!lastUpdate.isCompressed(), "lastUpdate should NOT be compressed during collapse mode");
  
                  smartDecompress(update, lastUpdate);
  
                  // collapser only can work if all consumers are already introduced
              } else if (allowCollapse && positions.size() >= expectedConsumers) {
                  // getting last added update
                  val lastUpdateIndex = updatesCounter.get();
  
                  // looking for max common non-applied update
                  long maxIdx = firstNotAppliedIndexEverywhere();
                  val array = Nd4j.create(shape);
  
                  val delta = lastUpdateIndex - maxIdx;
                  if (delta >= collapseThreshold) {
                      log.trace("Max delta to collapse: {}; Range: <{}...{}>", delta, maxIdx, lastUpdateIndex);
                      for (long e = maxIdx; e < lastUpdateIndex; e++) {
                          val u = updates.get(e);
                          if (u == null)
                              log.error("Failed on index {}", e);
                             // continue;
  
                          smartDecompress(u, array);
  
                          // removing updates array
                          updates.remove(e);
                      }
  
                      // decode latest update
                      smartDecompress(update, array);
  
                      // putting collapsed array back at last index
                      updates.put(lastUpdateIndex, array);
                      collapsedIndex.set(lastUpdateIndex);
  
                      // shift counter by 1
                      updatesCounter.getAndIncrement();
  
                      // we're saying that right now all updates within some range are collapsed into 1 update
                      collapsedMode.set(true);
                  } else {
                      updates.put(updatesCounter.getAndIncrement(), update);
                  }
              } else {
                  updates.put(updatesCounter.getAndIncrement(), update);
              }
          } finally {
              lock.writeLock().unlock();
          }
      }
docs: This mehtod adds update, with optional collapse
  @param update