/src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaptionFromSwapSchedules.java
short exerciseIndex = Arrays.binarySearch( regressionBasisfunctionTimes, exerciseTime) ;
int exerciseIndex = Arrays.binarySearch ( regressionBasisfunctionTimes, exerciseTime ) ;
final double[] regressionBasisfunctionTimes = Stream.concat(Arrays.stream(exerciseDates),Stream.of(swapEndDate)).mapToDouble(new ToDoubleFunction<LocalDate>() { @Override public double applyAsDouble(final LocalDate date) { return FloatingpointDate.getFloatingPointDateFromDate(modelReferenceDate, date.atStartOfDay()); } }).sorted().toArray(); final ArrayList<RandomVariable> basisFunctions = new ArrayList<>(); final double exerciseTime = evaluationTime; <extra_id_0> if(exerciseIndex < 0) { exerciseIndex = -exerciseIndex; } if(exerciseIndex >= exerciseDates.length) { exerciseIndex = exerciseDates.length-1; }