GeneratorBill extends GeneratorInstrument<GeneratorAttributeET> { @Override public BillTransactionDefinition generateInstrument(final ZonedDateTime date, final double marketQuote, final double notional, final GeneratorAttributeET attribute) { ArgumentChecker.notNull(date, "Reference date"); final int quantity = (int) Math.round(notional / _security.getNotional()); final ZonedDateTime settleDate = ScheduleCalculator.getAdjustedDate(date, _security.getSettlementDays(), _security.getCalendar()); return BillTransactionDefinition.fromYield(_security, quantity, settleDate, marketQuote, _security.getCalendar()); } GeneratorBill(final String name, final BillSecurityDefinition security); @Override BillTransactionDefinition generateInstrument(final ZonedDateTime date, final double marketQuote, 
      final double notional, final GeneratorAttributeET attribute);  }
@Test public void generateInstrument() { final double marketQuote = -0.0001; final double notional = 123000; final double quantity = 123; final GeneratorAttributeET attribute = new GeneratorAttributeET(false); final BillTransactionDefinition billGenerated = GENERATOR_BILL.generateInstrument(REFERENCE_DATE, marketQuote, notional, attribute); final ZonedDateTime dettleDate = ScheduleCalculator.getAdjustedDate(REFERENCE_DATE, SETTLEMENT_DAYS, CALENDAR); final BillTransactionDefinition billExpected = BillTransactionDefinition.fromYield(BILL_BEL_SEC_DEFINITION, quantity, dettleDate, marketQuote, CALENDAR); assertEquals("Bill Generator: generate instrument", billExpected, billGenerated); }