final Node<K,V> findNear(K key,int rel,Comparator<? super K> cmp){
  if (key == null)   throw new NullPointerException();
  for (; ; ) {
    for (Node<K,V> b=findPredecessor(key,cmp), n=b.next; ; ) {
      Object v;
      if (n == null)       return ((rel & LT) == 0 || b.isBaseHeader()) ? null : b;
      Node<K,V> f=n.next;
      if (n != b.next)       break;
      if ((v=n.value) == null) {
        n.helpDelete(b,f);
        break;
      }
      if (b.value == null || v == n)       break;
      int c=cpr(cmp,key,n.key);
      if ((c == 0 && (rel & EQ) != 0) || (c < 0 && (rel & LT) == 0))       return n;
      if (c <= 0 && (rel & LT) != 0)       return b.isBaseHeader() ? null : b;
      b=n;
      n=f;
    }
  }
}

final Node < K , V > findNear ( K key , int rel , Comparator < ? super K > cmp ) { if ( key == null ) throw new NullPointerException ( ) ; for ( ; ; ) { for ( Node < K , V > b = findPredecessor ( key , cmp ) , n = b . next ; ; ) { Object v ; if ( n == null ) return ( ( rel & LT ) == 0 || b . isBaseHeader ( ) ) ? null : b ; Node < K , V > f = n . next ; if ( n != b . next ) break ; if ( ( v = n . value ) == null ) { n . helpDelete ( b , f ) ; break ; } if ( b . value == null || v == n ) break ; int c = cpr ( cmp , key , n . key ) ; if ( ( c == 0 && ( rel & EQ ) != 0 ) || ( c < 0 && ( rel & LT ) == 0 ) ) return n ; if ( c <= 0 && ( rel & LT ) != 0 ) return b . isBaseHeader ( ) ? null : b ; b = n ; n = f ; } } }
utility for ceiling , floor , lower , higher methods .
