Check if the index array contains {@code i}.

TODO: sort arrays, use binary search!

@param is Array to search
@param i Index to search
@return Position of index i, or {@code -1} if not found.
979010
protected static int containsIndex(int[] is, int i) {
    for(int j = 0; j < is.length; j++) {
      if(i == is[j]) {
        return j;
      }
    }
    return -1;
  }
97866
public static boolean equalsValue(final Integer i1, final Integer i2) {
        if (i1 == null) {
            return i2 == null;
        }
        return i1.equals(i2);
    }
327265
public static int search(int[] intArray, int value) { 
        int start = 0;
        int end = intArray.length - 1;
        int middle = 0;
        
        while(start <= end) {
            middle = (start + end) >> 1;
        
            if(value == intArray[middle]) {
                return middle;
            }
            
            if(value < intArray[middle]) {
                end = middle - 1 ;
            }
            else {
                start = middle + 1;
            }
        }
                

        return -1;
    }
944200
public int get(int i, int j) {
        if (i < 0 || i >= size()) {
            throw new IllegalArgumentException("Invalid index: i = " + i);
        }

        int[] x = get(i).x;
        if (x.length == 0) {
            return 0;
        }
        
        int low = 0;
        int high = x.length - 1;
        int mid = (low + high) / 2;
        
        while (j != x[mid] && low <= high) {
            mid = (low + high) / 2;
            if (j < x[mid]) 
                high = mid - 1;
            else
                low = mid + 1;
        }
        
        if (j == x[mid]) {
            return 1;
        } else {
            return 0;
        }
    }
766612
private void checkAtMost(int i) throws ContradictionException {
		ISet ker = target.getMandSet(g, i);
		ISet env = target.getPotSet(g, i);
		int size = ker.size();
		if (size > degrees[i]) {
			g.removeNode(i, this);
		} else if (size == degrees[i] && env.size() > size) {
			for (int other : env) {
				if (!ker.contains(other)) {
					target.remove(g, i, other, this);
				}
			}
		}
	}
429763
public boolean contains(int s)
  {

    if (null == m_map)
      return false;

    for (int i = 0; i < m_firstFree; i++)
    {
      int node = m_map[i];

      if (node == s)
        return true;
    }

    return false;
  }
1081693
static int binarySearch(final boolean[] a, final boolean key) {
        if (N.isNullOrEmpty(a)) {
            return N.INDEX_NOT_FOUND;
        }

        if (a[0] == key) {
            return 0;
        } else if (a[a.length - 1] != key) {
            return N.INDEX_NOT_FOUND;
        }

        int left = 0, right = a.length - 1;
        while (left < right) {
            int mid = left + (right - left) / 2;

            if (a[mid] == key) {
                right = mid;
            } else {
                left = mid + 1;
            }
        }
        return left;
    }
845176
@Override
    public Byte get(int i)
    {
        if (checkIndex(i)) {
            throw new IndexOutOfBoundsException();
        }
        return (Byte)js_get(i);
    }
835705
protected boolean joinWithComparator(int i, int j) {
        if (comparator.compare(array[j], array[i]) < 0) {
            K tmp = array[i];
            array[i] = array[j];
            array[j] = tmp;
            reverse.flip(j);
            return false;
        }
        return true;
    }
1027510
private static boolean contains(int[] values, int searchValue) {
        Objects.requireNonNull(values);
        for (int value : values) {
            if (searchValue == value) {
                return true;
            }
        }
        return false;
    }
419761
public static <T> int binarySearch(final T[] a, final int fromIndex, final int toIndex, final T key, final Comparator<? super T> cmp) {
        return Array.binarySearch(a, fromIndex, toIndex, key, cmp);
    }
439659
public double get(int i) {
		if (i < 0 || i >= N) throw new IllegalArgumentException("Illegal index " + i + " should be > 0 and < " + N);
		if (symbolTable.contains(i)) return symbolTable.get(i);
		else                return 0.0;
	}
1257118
Integer indexOf(T t) {
        if (t == null) {
            return null;
        }
        Integer i = _set.get(t);
        if (i == null) {
            return -1;
        }
        return i;
    }
972648
function indexOf(element, fromIndex) {
    /* jshint validthis:true */
    var arr = toArray(this),
        index;

    if (fromIndex) {
        arr = arr.slice(fromIndex);
    }

    index = binarySearch(arr, element, this.comparator);

    if (index < 0) {
        return -1;
    } else {
        return index;
    }
}
546468
public int indexOf(int[] sequence) {
        int index = -1;
        for (int i = 0; index == -1 && i <= currentSize - sequence.length;
             i++) {
            if (buffer[i] == sequence[0]) {
                boolean matches = true;
                for (int j = 1; matches && j < sequence.length; j++) {
                    if (buffer[i + j] != sequence[j]) {
                        matches = false;
                    }
                }
                if (matches) {
                    index = i;
                }
            }
        }
        return index;
    }
255138
public KeyDeclaration getKey(int i) throws ArrayIndexOutOfBoundsException
  {

    if (null == m_keyDeclarations)
      throw new ArrayIndexOutOfBoundsException();

    return (KeyDeclaration) m_keyDeclarations.elementAt(i);
  }
39083
public synchronized boolean has(int index, Scriptable start) {
        Integer key = new Integer(index);
        return indexedProps.containsKey(key);
    }