private boolean replaceBadEntry(KBucketEntry entry){
  List<KBucketEntry> entriesRef=entries;
  for (int i=0, n=entriesRef.size(); i < n; i++) {
    KBucketEntry e=entriesRef.get(i);
    if (e.needsReplacement()) {
      modifyMainBucket(e,entry);
      return true;
    }
  }
  return false;
}

private boolean replaceBadEntry ( KBucketEntry entry ) { List < KBucketEntry > entriesRef = entries ; for ( int i = 0 , n = entriesRef . size ( ) ; i < n ; i ++ ) { KBucketEntry e = entriesRef . get ( i ) ; if ( e . needsReplacement ( ) ) { modifyMainBucket ( e , entry ) ; return true ; } } return false ; }
tries to instert entry by replacing a bad entry .
