code: public void replace(int bucketId, byte[][] keysToInsert) {
          if (bucketId < 0 || bucketId >= maxRangeValues.length) {
              throw new IllegalArgumentException("Invalid bucketId: " + bucketId);
          }
          int numberOfPartitions = keysToInsert.length;
          int newSize = this.getNumberOfBuckets() - 1 + numberOfPartitions;
          byte[][] newMaxRangeValues = new byte[newSize][];
          String[] newFileNames = new String[newSize];
  
          int k = 0;
          for (int i = 0; i < this.getNumberOfBuckets(); i++) {
              if (i != bucketId) {
                  newMaxRangeValues[k] = this.getUpperBound(i);
                  newFileNames[k] = this.getFilename(i);
                  k++;
              }
          }
          for (int i = this.getNumberOfBuckets() - 1; i < newSize; i++) {
              k = i - (this.getNumberOfBuckets() - 1);
              newMaxRangeValues[i] = keysToInsert[k];
              newFileNames[i] = generateFileName(k, this.getFilename(bucketId));
          }
  
          this.maxRangeValues = newMaxRangeValues;
          this.filenames = newFileNames;
  
          sort();
      }
docs: Replaces one bucket line within the {@link RangeHashFunction} with the lines given. All added buckets are set to
  the specified bucket size. If the <code>bucketId</code> that is to replaced is invalid a
  {@link IllegalArgumentException} is thrown.
  
  @param keysToInsert
  @param bucketId