Invert a set.
@return $this;
8045
public function invert()
    {

        $this->containsNull = !$this->containsNull;

        if( $this->intervals === array( array(null, null) ) ) {
            $this->intervals = array();
            return $this;
        }

        $output = array();
        $working = array( null, null );

        reset( $this->intervals );

        while( list(,$interval) = each($this->intervals) ) {

            if( $interval[0] === null ) {

                $working[0] = $this->nextHighestValue( $interval[1] );

            } elseif( $interval[1] === null ) {

                $working[1] = $this->nextLowestValue( $interval[0] );
                break;

            } else {

                $working[1] = $this->nextLowestValue( $interval[0] );
                $output[] = $working;

                $working = array(
                    $this->nextHighestValue( $interval[1] ),
                    null
                );

            }

        }

        $output[] = $working;
        $this->intervals = $output;
        return $this;

    }
174911
public function reversed(): Map
    {
        $reversed = new self();
        $reversed->pairs = array_reverse($this->pairs);

        return $reversed;
    }
733613
protected Set<E> set() {
    return elements.entrySet()
        .stream()
        .filter(entry -> !entry.getValue().isTombstone())
        .map(entry -> decode(entry.getKey()))
        .collect(Collectors.toSet());
  }
1199471
public Permutation invert() {
        Permutation inversion = new Permutation(values.length);
        for (int i = 0; i < values.length; i++) {
            inversion.values[this.values[i]] = i;
        }
        return inversion;
    }
164432
public function shuffle(): Collection
    {
        // Get keys and shuffle
        $keys = array_keys($this->list);
        shuffle($keys);

        // Attribute shuffle keys to theirs values
        $newList = [];
        foreach ($keys as $key) {
            $newList[$key] = $this->list[$key];
        }

        // Update list
        $this->list = $newList;

        return $this;
    }
948916
public function invert()
	{
		$interval = $this->copy($this->interval);
		$interval->invert = $interval->invert ? 0 : 1;

		return new DateInterval($interval);
	}
564896
public function reverse()
	{
		$length = $this->length();
		$reversed = '';
		while ($length-- > 0) {
			$reversed .= mb_substr($this->string, $length, 1, mb_detect_encoding($this->string));
		}
		$this->string = $reversed;
		return $this;
	}
410266
public function intersect(Set $set): Set
    {
        return $this->table->intersect($set->table)->keys();
    }
334138
public function reverse()
    {
        $entities = new Entities();

        foreach (array_reverse($this->_entities) as $entity) {
            $entities->add($entity);
        }

        return $entities;
    }
668575
private function decBalance()
    {
        $this->information -= 4;

        if ($this->information < - 4) {
            if ($this->left->information >= 4) {
                $this->left = $this->left->rotateLeft();
            }

            return $this->rotateRight();
        }

        return $this;
    }
793993
public function asSet(): Constructed\Set
    {
        if (!$this->_element instanceof Constructed\Set) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_SET));
        }
        return $this->_element;
    }
328441
public function set()
    {
        $args = func_get_args();

        if (count($args) == 2) {
            $this->attributes[$args[0]] = $args[1];
        } elseif (count($args) == 1 && is_array($args[0])) {
            $this->attributes = (array_merge($this->attributes, $args[0]));
        }

        return $this;
    }
547158
public function setAttributes()
    {
        $attributes = func_get_args();
        if (count($attributes)) {
            if (count($attributes) == 1 && is_array($attributes[0])) {
                $attributes = $attributes[0];
            }
            $this->attributes = $attributes;
        }

        return $this;
    }
433284
public function removeFieldset($i)
    {
        if (isset($this->fieldsets[(int)$i])) {
            unset($this->fieldsets[(int)$i]);
        }
        $this->fieldsets = array_values($this->fieldsets);
        if (!isset($this->fieldsets[$this->current])) {
            $this->current = (count($this->fieldsets) > 0) ? count($this->fieldsets) - 1 : 0;
        }
        return $this;
    }
1095212
public function setInverse($inverse)
    {
        if (!is_bool($inverse)) {
            throw new \InvalidArgumentException('The attribute inverse on the class Attribute has to be boolean (' . gettype($inverse) . ('object' === gettype($inverse) ? ' ' . get_class($inverse) : '') . ' given).');
        }

        $this->inverse = $inverse;

        return $this;
    }
680621
public function moveRightValue($diff)
    {
        $this->right += $diff;
        if (isset($this->nestedSetNode)) {
            $this->nestedSetNode->moveRightValue($diff);
        }
        return $this;
    }
377409
private function updateOffset()
    {
        if ($this->after()) {
            $this->params['after'] = $this->collection[$this->total_count - 1]['id'];
        } else {
            $this->params['before'] = $this->collection[$this->total_count - 1]['id'];
        }
        return $this;
    }