Inserts the object into a new element before the provided element.

@param next Element which will be after the new one
@param object The object which goes into the new element
@return The new element
552318
public Element<T> insertBefore( Element<T> next , T object ) {
		Element<T> e = requestNew();
		e.object = object;
		e.previous = next.previous;
		e.next = next;

		if( e.previous != null ) {
			e.previous.next = e;
		} else {
			first = e;
		}
		next.previous = e;
		size++;
		return e;
	}
470149
private function insert($object)
    {
        //TODO: this should only be done if there is a Delete query pending for the same entity table
        $this->manager->commit();

        $query = $this->manager
            ->getDriver()
            ->getQueryBuilder()
            ->insert($this->getTable());

        $query->values(
            $query->createPositionalParameter(
                array_filter(
                    $this->toArray($object),
                    [Utils::class, 'notNull']
                )
            )
        );

        return $this->setFieldValue(
            $object,
            $this->getPrimaryKey(),
            $query->query()
        );
    }
227862
public static void insertAfter(Element newElement, Element after) {
        after.parentNode.insertBefore(newElement, after.nextSibling);
    }
36127
public Element<T> pushTail( T object ) {
		Element<T> e = requestNew();
		e.object = object;

		if( last == null ) {
			first = last = e;
		} else {
			e.previous = last;
			last.next = e;
			last = e;
		}
		size++;

		return e;
	}
1220961
public synchronized Object next()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "next");

    Object next = null;
    if(hasNext())
    {
      next = this.next.data;
      removable = this.next;
      this.next = null;
    }
    else
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "next", "NoSuchElementException");
      throw new NoSuchElementException(
        nls.getFormattedMessage(
          "NO_ELEMENTS_ERROR_CWSIP0601",
          null,
          null));
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "next", next);

    return next;
  }
245903
public static final <T> Function<Object,T> replaceWith(final T object) {
        return new ReplaceWith<T>(object);
    }
1199588
@SuppressWarnings("NullAway")
  protected final @NonNull <T> T copyOf(@Nullable T object) {
    if (object == null) {
      return null;
    }
    T copy = copier.copy(object, cacheManager.getClassLoader());
    return requireNonNull(copy);
  }
730690
@Override
	public Object next() {
		Object object = cloner.deepClone(templateObject);

		Map<String, Object> values = nextValues();

		for (Map.Entry<String, Object> entry : values.entrySet()) {
			try {
				PropertyUtils.setProperty(object, entry.getKey(), entry.getValue());
			}
			catch (Exception e) {
				throw new RuntimeException(e);
			}
		}

		return object;
	}
562246
public void add(@NonNull final T object) {
        synchronized (mLock) {
            final int position = getItemCount();
            mObjects.add(object);
            notifyItemInserted(position);
        }
    }
1035227
public DataBinder put(Object object) throws Exception {
        for (Field field: Beans.getKnownInstanceFields(object.getClass())) {
            Object value = field.get(object);
            if (value != null) {
                put(field.getName(), value.toString());
            }
        }
        return this;
    }
1002737
public void addObject (int x, int y, Object object)
    {
        Record record = new Record(x, y, object);

        // if this is the very first element, we have to insert it
        // straight away because our binary search algorithm doesn't work
        // on empty arrays
        if (_size == 0) {
            _records[_size++] = record;
            return;
        }

        // figure out where to insert it
        int ipoint = binarySearch(x);

        // expand the records array if necessary
        if (_size >= _records.length) {
            int nsize = _size*2;
            Record[] records = new Record[nsize];
            System.arraycopy(_records, 0, records, 0, _size);
            _records = records;
        }

        // shift everything down
        if (ipoint < _size) {
            System.arraycopy(_records, ipoint, _records, ipoint+1,
                             _size-ipoint);
        }

        // insert the record
        _records[ipoint] = record;
        _size++;
    }
1018783
public Object nextElement()
    {
        try
        {
            if (!hasCalledCheck)
            {    
                hasMoreElements();
            }    
            hasCalledCheck = false;
            if (hasNext)
            {
                Identity oid = getIdentityFromResultSet();
                Identity[] args = {oid};
                return this.constructor.newInstance(args);
            }
            else
                throw new NoSuchElementException();
        }
        catch (Exception ex)
        {
            LoggerFactory.getDefaultLogger().error(ex);
            throw new NoSuchElementException();
        }
    }
908283
public void addObject(E object){
		if(stopped==true){
			log.warn("Adding a new object ignored, the pool is stopped");
			return ;
		}

		// add to the end
		objectList.add(object);
//		if (log.isDebugEnabled()){
//			log.debug("ADD, size:'"+objectListSize()+"' "+object.hashCode()+" stopped:"+stopedThreadNumber+" "+object.toString());
//		}

		// Waits for an stoped worked before returning !!!!
		// except if this thread is a thread of the pool 
		if (!objectList.isEmpty() && stopedThreadNumber==0 && !threadMap.containsKey(Thread.currentThread().getName())){
			synchronized (threadList) {
				try {
					threadList.wait();
				} catch (InterruptedException e) {
					
				}
			}
		}
		
		synchronized (objectList) {
			objectList.notify();
		}
	}
411380
function (node, newNode) {
        return node.nextSibling ? node.parentNode.insertBefore(newNode, node.nextSibling):
            node.parentNode.appendChild(newNode);
    }
1336434
function (object) {
            object.id = object.id || this.generateId();
            this.data.push(object);
            this.mapValues[object.id] = {};
            this.eachMap(function (map, mapName) {
                this.addObjectToMap(mapName, object);
            });
            return this;
        }
1221893
@SuppressWarnings("unchecked")
	public static <T> Object insert(Object array, int index, T... newElements) {
		if (isEmpty(newElements)) {
			return array;
		}
		if(isEmpty(array)) {
			return newElements;
		}
		
		final int len = length(array);
		if (index < 0) {
			index = (index % len) + len;
		}
		
		final T[] result = newArray(array.getClass().getComponentType(), Math.max(len, index) + newElements.length);
		System.arraycopy(array, 0, result, 0, Math.min(len, index));
		System.arraycopy(newElements, 0, result, index, newElements.length);
		if (index < len) {
			System.arraycopy(array, index, result, index + newElements.length, len - index);
		}
		return result;
	}
1018403
function ( obj, child ) {
		return obj.childNodes.length === 0 ? obj.appendChild( child ) : obj.insertBefore( child, obj.childNodes[0] );
	}