code: public void extendBound(double[] lowerBound, double[] upperBound) {
          if (lowerBound.length != dimension || upperBound.length != dimension) {
              throw new IllegalArgumentException(BOUND_SIZE_DON_T_MATCH_THE_DIMENSION);
          }
  
          boolean extend = false;
          for (int i = 0; i < lowerBound.length; i++) {
              if (lowerBound[i] < this.originalLowerBound[i]) {
                  this.originalLowerBound[i] = lowerBound[i];
                  extend = true;
              }
          }
  
          for (int i = 0; i < upperBound.length; i++) {
              if (upperBound[i] > this.originalUpperBound[i]) {
                  this.originalUpperBound[i] = upperBound[i];
                  extend = true;
              }
          }
  
          if (extend) {
              reset();
          }
      }
docs: Extend lower and upper bounds.