private int findUpper(T x,int from,int to){
  int len=to - from + 1, half;
  while (len > 0) {
    half=len / 2;
    int m=from + half;
    if (comp.compare(data[m],x) <= 0) {
      from=m + 1;
      len=len - half - 1;
    }
 else {
      len=half;
    }
  }
  return from;
}

private int findUpper ( T x , int from , int to ) { int len = to - from + 1 , half ; while ( len > 0 ) { half = len / 2 ; int m = from + half ; if ( comp . compare ( data [ m ] , x ) <= 0 ) { from = m + 1 ; len = len - half - 1 ; } else { len = half ; } } return from ; }
find the smallest element in the sorted array that is larger than or equal to x .
