public void insert(int id, Object result) {
        if (result == null) {
            logger.error("id {} is null", id);
        }
        int index = id - base;
        if (index < 0) {
            logger.debug("negative index {} for base {}.", index, base);
            index += size;
            if (index < 0) {
                logger.error("insert id out of window.");
                return;
            }
        } else {
            logger.debug("insert id {} base {}.", id, base);
        }
        if (buffer.compareAndSet(index, null, result)) {
            synchronized (consumerLock) {
                consumerLock.notify();
            }
            logger.debug("inserted {} at index {}.", result, index);
        } else {
            logger.error("index {} is not null.", index);
        }
    }