docs: private String keyOf(Object obj) {
      Object innerObj = obj;
      if (obj instanceof Deque) {
        Deque<MutablePair<DeltaType, Object>> deltas = (Deque<MutablePair<DeltaType, Object>>) obj;
        if (deltas.size() == 0) {
          throw new NoSuchElementException("0 length Deltas object; can't get key");
        }
        innerObj = deltas.peekLast().getRight();
      }
      if (innerObj instanceof DeletedFinalStateUnknown) {
        return ((DeletedFinalStateUnknown) innerObj).key;
      }
      return keyFunc.apply((ApiType) innerObj);
    }