//Calculating blackVariance
System.out.println("BlackVariance = "+constantVolatility.blackVariance(date10.clone(), 20));
//Calculating blackForwardVariance
System.out.println("BlackForwardVariance = "+constantVolatility.blackForwardVariance(date10.clone(), date15.clone(), 20, true));
//As BlackConstantVol termstructure has been initialized using relinkable handle so lets change the observable SimpleQuote of this handle
//and see the change getting reflected to all the calculations done above.
volatilityQuote.setValue(0.04) ;
constantVolatility = new BlackConstantVol(2,new UnitedStates(Market.NYSE),handleToVolatilityQuote, new Actual365Fixed());