code: protected static int containsIndex(int[] is, int i) {
      for(int j = 0; j < is.length; j++) {
        if(i == is[j]) {
          return j;
        }
      }
      return -1;
    }
docs: 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.