@SuppressWarnings("deprecation")
 @Test
 public void testToDerivativeDeprecated() {
   final String[] names = new String[] {"USD", "EUR"};
   final ForexOptionSingleBarrier derivative = OPTION.toDerivative(DATE, names);
   assertEquals(derivative.getUnderlyingOption(), UNDERLYING.toDerivative(DATE, names));
   assertEquals(derivative.getBarrier(), BARRIER);
 }
 /**
  * {@inheritDoc}
  *
  * @deprecated Use the method that does not take yield curve names
  */
 @Deprecated
 @Override
 public ForexOptionSingleBarrier toDerivative(
     final ZonedDateTime date, final String... yieldCurveNames) {
   ArgumentChecker.notNull(date, "date");
   ArgumentChecker.notNull(yieldCurveNames, "yield curve names");
   final ForexOptionVanilla underlying = _underlyingOption.toDerivative(date, yieldCurveNames);
   return new ForexOptionSingleBarrier(underlying, _barrier);
 }
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + _barrier.hashCode();
   long temp;
   temp = Double.doubleToLongBits(_rebate);
   result = prime * result + (int) (temp ^ (temp >>> 32));
   result = prime * result + _underlyingOption.hashCode();
   return result;
 }
 @Override
 public ForexOptionSingleBarrier toDerivative(final ZonedDateTime date) {
   ArgumentChecker.notNull(date, "date");
   final ForexOptionVanilla underlying = _underlyingOption.toDerivative(date);
   return new ForexOptionSingleBarrier(underlying, _barrier);
 }
 @Test
 public void testToDerivative() {
   final ForexOptionSingleBarrier derivative = OPTION.toDerivative(DATE);
   assertEquals(derivative.getUnderlyingOption(), UNDERLYING.toDerivative(DATE));
   assertEquals(derivative.getBarrier(), BARRIER);
 }