code: public BinarySearchResult<V> binarySearch(V value, Codec codec) {
          int size = list.size();
          int upperIndex = size - 1;
          int lowerIndex = 0;
          while (lowerIndex <= upperIndex) {
              int index = lowerIndex + (upperIndex - lowerIndex) / 2;
  
              V res = list.getValue(index);
              if (res == null) {
                  return new BinarySearchResult<V>();
              }
              int cmp = comparator.compare(value, res);
  
              if (cmp == 0) {
                  BinarySearchResult<V> indexRes = new BinarySearchResult<V>();
                  indexRes.setIndex(index);
                  return indexRes;
              } else if (cmp < 0) {
                  upperIndex = index - 1;
              } else {
                  lowerIndex = index + 1;
              }
          }
  
          BinarySearchResult<V> indexRes = new BinarySearchResult<V>();
          indexRes.setIndex(-(lowerIndex + 1));
          return indexRes;
      }
docs: TODO optimize: get three values each time instead of single