ForexNonDeliverableOptionDefinition implements InstrumentDefinition<InstrumentDerivative> { @Override public ForexNonDeliverableOption toDerivative(final ZonedDateTime date) { return new ForexNonDeliverableOption(_underlyingNDF.toDerivative(date), _isCall, _isLong); } ForexNonDeliverableOptionDefinition(final ForexNonDeliverableForwardDefinition forex, final boolean isCall, final boolean isLong); ForexNonDeliverableForwardDefinition getUnderlyingNDF(); boolean isCall(); boolean isLong(); @Override ForexNonDeliverableOption 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 ForexNonDeliverableOption ndoConverted = NDO_DEFINITION.toDerivative(REFERENCE_DATE); final ForexNonDeliverableOption ndoExpected = new ForexNonDeliverableOption(NDF_DEFINITION.toDerivative(REFERENCE_DATE), IS_CALL, IS_LONG); assertEquals("Forex NDO - toDerivatives", ndoExpected, ndoConverted); }