// "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
System.out.println(" Method European Bermudan American");
System.out.println("================================== ============= ============= =============");
// Define exercise for European Options
final Exercise europeanExercise = new EuropeanExercise(maturity);
// Define exercise for Bermudan Options
final int bermudanForwards = 4;
final Date[] exerciseDates = new Date[bermudanForwards];
for (int i = 1; i <= bermudanForwards; i++) {
exerciseDates[i-1] = settlementDate.add(new Period(3 * i, TimeUnit.Months));
}
final Exercise bermudanExercise = new BermudanExercise(exerciseDates);
// Define exercise for American Options
final Exercise americanExercise = new AmericanExercise(settlementDate, maturity);
// bootstrap the yield/dividend/volatility curves
final Handle<Quote> underlyingH = new Handle<Quote>(new SimpleQuote(underlying));
final Handle<YieldTermStructure> flatDividendTS = new Handle<YieldTermStructure>(new FlatForward(settlementDate, dividendYield, dayCounter));
final Handle<YieldTermStructure> flatTermStructure = new Handle<YieldTermStructure>(new FlatForward(settlementDate, riskFreeRate, dayCounter));