public virtual void test_firstDerivative()
        {
            InterpolatedNodalCurve curve = InterpolatedNodalCurve.of(METADATA, DoubleArray.of(0, 1), DoubleArray.of(2, 2.5), CurveInterpolators.LINEAR);

            Curve absoluteShiftedCurve = ParallelShiftedCurve.absolute(curve, 1);
            Curve relativeShiftedCurve = ParallelShiftedCurve.relative(curve, 0.2);

            assertThat(curve.firstDerivative(0.1)).isEqualTo(0.5);
            assertThat(absoluteShiftedCurve.firstDerivative(0.1)).isEqualTo(0.5);
            assertThat(relativeShiftedCurve.firstDerivative(0.1)).isEqualTo(0.5 * 1.2);
        }
        //-------------------------------------------------------------------------
        public virtual void test_yValueParameterSensitivity()
        {
            InterpolatedNodalCurve curve = InterpolatedNodalCurve.of(METADATA, DoubleArray.of(0, 1), DoubleArray.of(2, 2.5), CurveInterpolators.LINEAR);

            Curve absoluteShiftedCurve = ParallelShiftedCurve.absolute(curve, 1);
            Curve relativeShiftedCurve = ParallelShiftedCurve.relative(curve, 0.2);

            UnitParameterSensitivity expected = curve.yValueParameterSensitivity(0.1);

            assertThat(absoluteShiftedCurve.yValueParameterSensitivity(0.1)).isEqualTo(expected);
            assertThat(relativeShiftedCurve.yValueParameterSensitivity(0.1)).isEqualTo(expected);
        }
        public virtual void test_relative()
        {
            CurveParallelShifts test = CurveParallelShifts.relative(0.1d, 0.2d, 0.4d);

            Curve baseCurve = InterpolatedNodalCurve.of(Curves.zeroRates("curve", DayCounts.ACT_365F), DoubleArray.of(1, 2, 3), DoubleArray.of(5, 6, 7), CurveInterpolators.LOG_LINEAR);

            MarketDataBox <Curve> shiftedCurveBox = test.applyTo(MarketDataBox.ofSingleValue(baseCurve), REF_DATA);

            assertEquals(shiftedCurveBox.getValue(0), ParallelShiftedCurve.relative(baseCurve, 0.1d));
            assertEquals(shiftedCurveBox.getValue(1), ParallelShiftedCurve.relative(baseCurve, 0.2d));
            assertEquals(shiftedCurveBox.getValue(2), ParallelShiftedCurve.relative(baseCurve, 0.4d));
        }
        public virtual void relative()
        {
            ParallelShiftedCurve test = ParallelShiftedCurve.relative(CONSTANT_CURVE, 0.1d);

            assertThat(test.UnderlyingCurve).isEqualTo(CONSTANT_CURVE);
            assertThat(test.ShiftType).isEqualTo(ShiftType.RELATIVE);
            assertThat(test.ShiftAmount).isEqualTo(0.1d);
            assertThat(test.Metadata).isEqualTo(METADATA);
            assertThat(test.Name).isEqualTo(METADATA.CurveName);
            assertThat(test.ParameterCount).isEqualTo(2);
            assertThat(test.getParameter(0)).isEqualTo(3d);
            assertThat(test.getParameter(1)).isEqualTo(0.1d);
            assertThat(test.getParameterMetadata(0)).isEqualTo(ParameterMetadata.empty());
            assertThat(test.getParameterMetadata(1)).isEqualTo(LabelParameterMetadata.of("RelativeShift"));
            assertThat(test.withParameter(0, 5d)).isEqualTo(ParallelShiftedCurve.relative(CONSTANT_CURVE2, 0.1d));
            assertThat(test.withParameter(1, 0.5d)).isEqualTo(ParallelShiftedCurve.relative(CONSTANT_CURVE, 0.5d));
            assertThat(test.withPerturbation((i, v, m) => v + 2d)).isEqualTo(ParallelShiftedCurve.relative(CONSTANT_CURVE2, 2.1d));
            assertThat(test.yValue(0)).isEqualTo(3.3d, offset(1e-10d));
            assertThat(test.yValue(1)).isEqualTo(3.3d, offset(1e-10d));
        }