code: public static <E extends Comparable<E>> int search(List<E> list, E value) { 
          int start = 0;
          int end = list.size() - 1;
          int middle = 0;
          
          while(start <= end) {
              middle = (start + end) >> 1;
          
              if(value.equals(list.get(middle))) {
                  return middle;
              }
              
              if(value.compareTo(list.get(middle)) < 0) {
                  end = middle - 1 ;
              }
              else {
                  start = middle + 1;
              }
          }
                  
  
          return -1;
      }
docs: Search for the value in the sorted list and return the index. The run time of this algorithm depends on the
  implementation of the list. It is advised to use an array based implementation
  to achieve O(log (n)) runtime.
  
  @param <E> the type of elements in this list.
  
  @param list list that we are searching in.
  @param value value that is being searched in the list.
  
  @return the index where the value is found in the list, else -1.