Swap the input pair and return the swapped pair.

@return A function that gets the swapped pair {@code Iterable}
177799
public static <S, T> Function<Pair<S, T>, Pair<T, S>> swappedPair()
    {
        return (Function<Pair<S, T>, Pair<T, S>>) (Function<?, ?>) SWAPPED_PAIR_FUNCTION;
    }
162673
public static <T> ImmutableMultimap<T, Integer> itemToIndexMultimap(
      Iterable<T> iterable) {
    final ImmutableMultimap.Builder<T, Integer> ret = ImmutableMultimap.builder();
    int idx = 0;
    for (final T x : iterable) {
      ret.put(x, idx++);
    }
    return ret.build();
  }
945482
def pairwise(iterable):
    
    iterable = iter(iterable)
    left = next(iterable)
    for right in iterable:
        yield left, right
        left = right
72379
function swap(array, i, j) {
    var temp = array[i];
    array[i] = array[j];
    array[j] = temp;
  }
1267605
public static <E> MutableObjectIterator<E> get() {
		@SuppressWarnings("unchecked")
		MutableObjectIterator<E> iter = (MutableObjectIterator<E>) INSTANCE;
		return iter;
	}
217547
public static <E> Iterable<E> cast(final Iterable i) {
        return map(i, new Mapper<Object, E>() {
                public E apply(Object o) {
                    return (E) o;
                }
            });
    }
84095
public function swap()
    {
        $compare1 = $this->compare1;

        $this->compare1 = $this->compare2;

        $this->compare2 = $compare1;

        return $this;
    }
766034
public static <T> Iterable<T> simpleIterable(final Iterable<T> iterable) {
        requireNonNull(iterable);
        return () -> iterable.iterator();
    }
311457
public <R> Choice<R> transform(final Function<? super T, R> function) {
    checkNotNull(function);
    final Choice<T> thisChoice = this;
    return new Choice<R>() {
      @Override
      protected Iterator<R> iterator() {
        return Iterators.transform(thisChoice.iterator(), function);
      }
    };
  }
1272108
public static Object swap(Object array, int index1, int index2) {
		if (isEmpty(array)) {
			throw new IllegalArgumentException("Array must not empty !");
		}
		Object tmp = get(array, index1);
		Array.set(array, index1, Array.get(array, index2));
		Array.set(array, index2, tmp);
		return array;
	}
898655
public static <T> Iterator<T> getUnmodifiableIterator (Iterable<T> c)
    {
        return getUnmodifiableIterator(c.iterator());
    }
1369256
private static final void swap(int[] keys, Object[][] values, int i, int j) {
    int keySwap = keys[i];
    keys[i] = keys[j];
    keys[j] = keySwap;

    Object swapValue;
    for (int k = 0; k < values.length; k++) {
      swapValue = values[k][i];
      values[k][i] = values[k][j];
      values[k][j] = swapValue;
    }
  }
674850
public <NR> @NonNull Pair<L, NR> rmap(final @NonNull Function<? super R, ? extends NR> function) {
    return new Pair<>(this.left, function.apply(this.right));
  }
669288
public static void swap(int[] x, int i, int j) {
        int s = x[i];
        x[i] = x[j];
        x[j] = s;
    }
121185
public static <E> void swap(E[] x, E[] y) {
        if (x.length != y.length) {
            throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));
        }

        for (int i = 0; i < x.length; i++) {
            E s = x[i];
            x[i] = y[i];
            y[i] = s;
        }
    }
188472
public static <T> Iterable<T> concat( final Iterable<T> a,
                                          final Iterable<T> b ) {
        assert (a != null);
        assert (b != null);
        return () -> Collections.concat(a.iterator(), b.iterator());

    }
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;
    }