ForexDefinition implements InstrumentDefinition<InstrumentDerivative> { @Override public String toString() { String result = "Forex transaction:"; result += "\nCurrency 1 payment: " + _paymentCurrency1.toString(); result += "\nCurrency 2 payment: " + _paymentCurrency2.toString(); return result; } ForexDefinition(final Currency currency1, final Currency currency2, final ZonedDateTime exchangeDate, final double amountCurrency1, final double fxRate);  ForexDefinition(final PaymentFixedDefinition paymentCurrency1, final PaymentFixedDefinition paymentCurrency2); static ForexDefinition fromAmounts(final Currency currency1, final Currency currency2, final ZonedDateTime exchangeDate, final double amountCurrency1,
      final double amountCurrency2); PaymentFixedDefinition getPaymentCurrency1(); PaymentFixedDefinition getPaymentCurrency2(); Currency getCurrency1(); Currency getCurrency2(); ZonedDateTime getExchangeDate(); @Override Forex toDerivative(final ZonedDateTime date); @Override V accept(final InstrumentDefinitionVisitor<U, V> visitor, final U data); @Override V accept(final InstrumentDefinitionVisitor<?, V> visitor); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void testToString() { final String fxToString = FX.toString(); final String expected = "Forex transaction:\nCurrency 1 payment: \nPayment Currency = EUR, Date = 2011-05-24T00:00ZAmount = 1.0E8" + "\nCurrency 2 payment: \nPayment Currency = USD, Date = 2011-05-24T00:00ZAmount = -1.4177E8"; assertEquals(expected, fxToString); }