final SimpleQuote riskFreeRateQuote = new SimpleQuote(0.3);
final RelinkableHandle<Quote> handleToRiskFreeRateQuote = new RelinkableHandle<Quote>(riskFreeRateQuote);
final YieldTermStructure riskFreeTermStructure = new FlatForward(2,new UnitedStates(Market.NYSE),handleToRiskFreeRateQuote, new Actual365Fixed(), Compounding.Continuous,Frequency.Daily);
//Creating the process
final StochasticProcess1D process = new GeneralizedBlackScholesProcess(handleToStockQuote,new RelinkableHandle<YieldTermStructure>(dividendTermStructure),new RelinkableHandle<YieldTermStructure>(riskFreeTermStructure),new RelinkableHandle<BlackVolTermStructure>(varianceCurve),new EulerDiscretization());
//Calculating the drift of the stochastic process after time = 18th day from today with value of the stock as specified from the quote
//The drift = (riskFreeForwardRate - dividendForwardRate) - (Variance/2)
System.out.println("The drift of the process after time = 18th day from today with value of the stock as specified from the quote = "+process.drift(process.time(date18.clone()), handleToStockQuote.currentLink().value()));