public boolean add(Long value){
  if (heap.contains(value)) {
    return true;
  }
 else   if (heap.size() < sampleSize) {
    heap.add(value);
    return true;
  }
 else   if (value > heap.element()) {
    heap.remove();
    heap.add(value);
    return true;
  }
 else {
    return false;
  }
}

public boolean add ( Long value ) { if ( heap . contains ( value ) ) { return true ; } else if ( heap . size ( ) < sampleSize ) { heap . add ( value ) ; return true ; } else if ( value > heap . element ( ) ) { heap . remove ( ) ; heap . add ( value ) ; return true ; } else { return false ; } }
adds a value to the heap , returning whether the value is ( large enough to be ) in the heap .
