BillSecurityDefinition implements InstrumentDefinition<BillSecurity> { @Deprecated public BillSecurity toDerivative(final ZonedDateTime date, final ZonedDateTime settlementDate, final String... yieldCurveNames) { throw new UnsupportedOperationException(this.getClass().getCanonicalName()); } BillSecurityDefinition(final Currency currency, final ZonedDateTime endDate, final double notional,
                                final int settlementDays, final Calendar calendar, final YieldConvention yieldConvention,
                                final DayCount dayCount, final String issuer);  BillSecurityDefinition(final Currency currency, final ZonedDateTime endDate, final double notional,
                                final int settlementDays, final Calendar calendar, final YieldConvention yieldConvention,
                                final DayCount dayCount, final LegalEntity issuer); Currency getCurrency(); ZonedDateTime getEndDate(); double getNotional(); int getSettlementDays(); Calendar getCalendar(); YieldConvention getYieldConvention(); DayCount getDayCount(); String getIssuer(); LegalEntity getIssuerEntity(); @Override String toString(); @Deprecated BillSecurity toDerivative(final ZonedDateTime date, final ZonedDateTime settlementDate, final String... yieldCurveNames); BillSecurity toDerivative(final ZonedDateTime date, final ZonedDateTime settlementDate); @Override BillSecurity toDerivative(final ZonedDateTime date); @Override V accept(final InstrumentDefinitionVisitor<U, V> visitor, final U data); @Override V accept(final InstrumentDefinitionVisitor<?, V> visitor); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void toDerivative() { final ZonedDateTime standardSettlementDate = ScheduleCalculator.getAdjustedDate(REFERENCE_DATE, SETTLEMENT_DAYS, CALENDAR); final BillSecurity securityConverted1 = BILL_SEC_DEFINITION1.toDerivative(REFERENCE_DATE, standardSettlementDate); final double standardSettlementTime = TimeCalculator.getTimeBetween(REFERENCE_DATE, standardSettlementDate); final double endTime = TimeCalculator.getTimeBetween(REFERENCE_DATE, END_DATE); final double accrualFactorStandard = ACT360.getDayCountFraction(standardSettlementDate, END_DATE); final BillSecurity securityExpected1 = new BillSecurity(EUR, standardSettlementTime, endTime, NOTIONAL, YIELD_CONVENTION, accrualFactorStandard, ISSUER_BEL_NAME); assertEquals("Bill Security Definition: toDerivative", securityExpected1, securityConverted1); final BillSecurity securityConverted2 = BILL_SEC_DEFINITION1.toDerivative(REFERENCE_DATE); assertEquals("Bill Security Definition: toDerivative", securityExpected1, securityConverted2); final ZonedDateTime otherSettlementDate = ScheduleCalculator.getAdjustedDate(REFERENCE_DATE, SETTLEMENT_DAYS + 1, CALENDAR); final BillSecurity securityConverted3 = BILL_SEC_DEFINITION1.toDerivative(REFERENCE_DATE, otherSettlementDate); final double otherSettlementTime = TimeCalculator.getTimeBetween(REFERENCE_DATE, otherSettlementDate); final double accrualFactorOther = ACT360.getDayCountFraction(otherSettlementDate, END_DATE); final BillSecurity securityExpected3 = new BillSecurity(EUR, otherSettlementTime, endTime, NOTIONAL, YIELD_CONVENTION, accrualFactorOther, ISSUER_BEL_NAME); assertEquals("Bill Security Definition: toDerivative", securityExpected3, securityConverted3); }