public boolean contains(Node node){
  int low=0;
  int high=nodes.size() - 1;
  while (low <= high) {
    int mid=(low + high) >>> 1;
    Node midVal=nodes.get(mid);
    if (midVal.ID < node.ID) {
      low=mid + 1;
    }
 else     if (midVal.ID > node.ID) {
      high=mid - 1;
    }
 else {
      return true;
    }
  }
  return false;
}

public boolean contains ( Node node ) { int low = 0 ; int high = nodes . size ( ) - 1 ; while ( low <= high ) { int mid = ( low + high ) > > > 1 ; Node midVal = nodes . get ( mid ) ; if ( midVal . ID < node . ID ) { low = mid + 1 ; } else if ( midVal . ID > node . ID ) { high = mid - 1 ; } else { return true ; } } return false ; }
checks for membership of a node to the nodeset . checking is done with binary search on the candidates , assuming an ordered list .
