final YieldAndDiscountCurve riskFreeCurve = YieldCurve.from(ConstantDoublesCurve.from(0.0));
final double[] tau = new double[] {0.25, 0.5, 0.75, 1, 2, 3, 4};
final double[] alpha = new double[] {0.23, 0.24, 0.25, 0.26, 0, 0, 0};
final double[] beta = new double[] {0, 0, 0, 0, 0.15, 0.2, 0.3};
final AffineDividends dividends = new AffineDividends(tau, alpha, beta);
final ForwardCurveAffineDividends curve1 = new ForwardCurveAffineDividends(spot, riskFreeCurve, dividends);
final ForwardCurveAffineDividends curve2 = cycleObject(ForwardCurveAffineDividends.class, curve1);
assertEquals(curve1.getSpot(), curve2.getSpot(), EPS);
assertTrue(curve2.getForwardCurve() instanceof FunctionalDoublesCurve);
assertTrue(curve2.getDriftCurve() instanceof FunctionalDoublesCurve);
assertCurveEquals(curve1.getForwardCurve(), curve2.getForwardCurve());
assertCurveEquals(curve1.getDriftCurve(), curve2.getDriftCurve());
assertTrue(curve1.equals(curve2));
assertTrue(curve1.getRiskFreeCurve().equals(curve2.getRiskFreeCurve()));
assertTrue(curve1.getDividends().equals(curve2.getDividends()));
}