code: public static <T> int lowerBound(List<? extends Comparable<? super T>> list,
        T key) {
      int low = 0;
      int high = list.size();
  
      while (low < high) {
        int mid = (low + high) >>> 1;
        Comparable<? super T> midVal = list.get(mid);
        int ret = midVal.compareTo(key);
        if (ret < 0)
          low = mid + 1;
        else high = mid;
      }
      return low;
    }
docs: Lower bound binary search. Find the index to the first element in the list
  that compares greater than or equal to key.
  
  @param <T>
  Type of the input key.
  @param list
  The list
  @param key
  The input key.
  @return The index to the desired element if it exists; or list.size()
  otherwise.