BondFixedTransactionDefinition extends BondTransactionDefinition<PaymentFixedDefinition, CouponFixedDefinition> { public static BondFixedTransactionDefinition fromYield(final BondFixedSecurityDefinition underlyingBond, final double quantity, final ZonedDateTime settlementDate, final double yield) { ArgumentChecker.notNull(settlementDate, "settlement date"); ArgumentChecker.notNull(underlyingBond, "underlying bond"); BondFixedSecurity security = underlyingBond.toDerivative(settlementDate, settlementDate); double cleanPrice = METHOD_BOND.cleanPriceFromYield(security, yield); return new BondFixedTransactionDefinition(underlyingBond, quantity, settlementDate, cleanPrice); } BondFixedTransactionDefinition(final BondFixedSecurityDefinition underlyingBond, final double quantity, 
      final ZonedDateTime settlementDate, final double cleanPrice); static BondFixedTransactionDefinition fromYield(final BondFixedSecurityDefinition underlyingBond, 
      final double quantity, final ZonedDateTime settlementDate, final double yield); double getAccruedInterestAtSettlement(); @Override BondFixedSecurityDefinition getUnderlyingBond(); @Override BondFixedTransaction 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(expectedExceptions = IllegalArgumentException.class) public void testNullUnderlyingYield() { BondFixedTransactionDefinition.fromYield(null, QUANTITY, SETTLEMENT_DATE, PRICE_DIRTY); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullSettleYield() { BondFixedTransactionDefinition.fromYield(BOND_SECURITY_DEFINITION, QUANTITY, null, YIELD); }