ExtremeSpreadOptionDefinition extends OptionDefinition { public double getTimeFromPeriodEnd(final ZonedDateTime date) { Validate.notNull(date, "date"); return DateUtils.getDifferenceInYears(_periodEnd.getExpiry(), date); } ExtremeSpreadOptionDefinition(final Expiry expiry, final boolean isCall, final Expiry periodEnd, final boolean isReverse); @SuppressWarnings("unchecked") @Override OptionExerciseFunction<StandardOptionWithSpotTimeSeriesDataBundle> getExerciseFunction(); @SuppressWarnings("unchecked") @Override OptionPayoffFunction<StandardOptionWithSpotTimeSeriesDataBundle> getPayoffFunction(); double getTimeFromPeriodEnd(final ZonedDateTime date); Expiry getPeriodEnd(); boolean isReverse(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullDate() { PUT.getTimeFromPeriodEnd(null); }