Get a {@link Collector} that calculates the <code>BIT_OR()</code> for any
type of {@link Number}.
760823
public static <T, U> Collector<T, ?, Long> bitOrLong(ToLongFunction<? super T> function) {
        return Collector.of(() -> new long[1],
            (s, v) -> {
                s[0] = s[0] | function.applyAsLong(v);
            },
            (s1, s2) -> {
                s1[0] = s1[0] | s2[0];
                return s1;
            },
            s -> s[0]
        );
    }
811789
public static <T> Collector<T, AtomicReference<T>, Optional<T>> unique() {
        return Collector.of(
                AtomicReference::new,
                CollectorUtils::uniqueAccumulate,
                CollectorUtils::uniqueCombine,
                ref -> Optional.ofNullable(ref.get())
        );
    }
183755
public static <T extends Comparable<? super T>> Collector<T, ?, Optional<T>> min() {
        return minBy(t -> t, naturalOrder());
    }
537198
public static <T, U> Collector<T, ?, Optional<Long>> rankBy(U value, Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return Collector.of(
            () -> new long[] { -1L },
            (l, v) -> {
                if (l[0] == -1L)
                    l[0] = 0L;

                if (comparator.compare(value, function.apply(v)) > 0)
                    l[0] = l[0] + 1L;
            },
            (l1, l2) -> {
                l1[0] = (l1[0] == -1 ? 0L : l1[0]) +
                        (l2[0] == -1 ? 0L : l2[0]);

                return l1;
            },
            l -> l[0] == -1 ? Optional.empty() : Optional.of((long) l[0])
        );
    }
1140394
public static <T extends Comparable<? super T>> Collector<T, ?, Optional<T>> max() {
        return maxBy(t -> t, naturalOrder());
    }
445253
public static int fromBinary(boolean[] binary)
    {
        Check.notNull(binary);

        int number = 0;
        for (final boolean current : binary)
        {
            number = number << 1 | boolToInt(current);
        }
        return number;
    }
361607
public boolean any()
    {
        int l = bits/8;
        for (int ii=0;ii<l;ii++)
        {
            if (array[ii] != 0)
            {
                return true;
            }
        }
        for (int ii=l*8;ii<bits;ii++)
        {
            if (isSet(ii))
            {
                return true;
            }
        }
        return false;
    }
192699
public static final BigInteger getBigInteger(Number value)
   {
      BigInteger result = null;
      if (value != null)
      {
         if (value instanceof BigInteger)
         {
            result = (BigInteger) value;
         }
         else
         {
            result = BigInteger.valueOf(Math.round(value.doubleValue()));
         }
      }
      return (result);
   }
475958
public static <T> Collector<T, Set<T>, Set<T>> toSet() {
    return Collector.of(
      HashSet::new,
      Set::add,
      (left, right) -> {
        left.addAll(right);
        return left;
      },
      ImmutableSet::copyOf);
  }
1353096
public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<Long>> rankBy(U value, Function<? super T, ? extends U> function) {
        return rankBy(value, function, naturalOrder());
    }
1203310
public Collection getAsCollection(byte b) {
		String[] lines = getAsStringArray(b);
		if (lines == null)
			return new ArrayList();
		else
			return arrayToCollection(lines);
	}
192188
public BigInteger getAndDecrement() {
        while (true) {
        	BigInteger current = get();
        	BigInteger next = current.subtract(BigInteger.ONE);
            if (compareAndSet(current, next))
                return current;
        }
    }
1079175
public static <T> Collector<T, ?, Boolean> noneMatch(Predicate<? super T> predicate) {
        return allMatch(predicate.negate());
    }
770863
@SuppressWarnings({ "rawtypes", "unchecked" })
    public static <T, U> Collector<T, ?, Optional<U>> avg(Function<? super T, ? extends U> function) {
        return Collector.of(
            () -> (Sum<U>[]) new Sum[1],
            (s, v) -> {
                if (s[0] == null)
                    s[0] = Sum.create(function.apply(v));
                else
                    s[0].add(function.apply(v));
            },
            (s1, s2) -> {
                s1[0].add(s2[0]);
                return s1;
            },
            s -> s[0] == null ? Optional.empty() : Optional.of(s[0].avg())
        );
    }
147898
public Container or(Container x) {
    if (x instanceof ArrayContainer) {
      return or((ArrayContainer) x);
    } else if (x instanceof BitmapContainer) {
      return or((BitmapContainer) x);
    }
    return or((RunContainer) x);
  }
1150963
protected AstNode or(boolean required) throws ScanException, ParseException {
		AstNode v = and(required);
		if (v == null) {
			return null;
		}
		while (true) {
			switch (token.getSymbol()) {
				case OR:
					consumeToken();
					v = createAstBinary(v, and(true), AstBinary.OR);
					break;
				case EXTENSION:
					if (getExtensionHandler(token).getExtensionPoint() == ExtensionPoint.OR) {
						v = getExtensionHandler(consumeToken()).createAstNode(v, and(true));
						break;
					}
				default:
					return v;
			}
		}
	}
1066395
public static <T> Collector<T, ?, Deque<T>> reverse() {
        return Collector.of(LinkedList::new, Deque::addFirst, (left, right) -> {
            right.addAll(left);
            return right;
        });
    }