//Calculating discount factor
System.out.println("The discount factor for the date 30 days from today is = "+flatforward.discount(date30.clone()));
//Calculating forward rate
System.out.println("The forward rate between the date 30 days from today to 50 days from today is = "+flatforward.forwardRate(date30.clone(), date50.clone(), new Actual365Fixed(), Compounding.Continuous).rate());
//Calculating parRate for the dates as shown below-
final Date[] dates = { date10.clone(), date20.clone(), date30.clone(), date40.clone(), date50.clone() };
System.out.println("The par rate for the bond having coupon dates as shown above is = "+flatforward.parRate(dates, Frequency.Semiannual, false));