ConstantDoublesCurve extends DoublesCurve { public InterpolatedDoublesCurve toInterpolatedDoublesCurve(final double[] x, final Interpolator1D interpolator) { ArgumentChecker.notNull(x, "x"); ArgumentChecker.notNull(interpolator, "interpolator"); final double[] y = new double[x.length]; Arrays.fill(y, _y); return InterpolatedDoublesCurve.from(x, y, interpolator); } protected  ConstantDoublesCurve();  ConstantDoublesCurve(final double y);  ConstantDoublesCurve(final double y, final String name); static ConstantDoublesCurve from(final double y); static ConstantDoublesCurve from(final double y, final String name); @Override Double[] getXData(); @Override Double[] getYData(); @Override Double getYValue(final Double x); @Override Double[] getYValueParameterSensitivity(final Double x); InterpolatedDoublesCurve toInterpolatedDoublesCurve(final double[] x, final Interpolator1D interpolator); @Override double getDyDx(final double x); @Override int size(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString(); static ConstantDoublesCurve.Meta meta(); @Override ConstantDoublesCurve.Meta metaBean(); final Property<Double> y(); @Override ConstantDoublesCurve clone();  }
@Test public void testConvert() { final double eps = 1e-15; final double[] x = new double[] {0, 1, 2}; final double[] y = new double[] {Y1, Y1, Y1}; final LinearInterpolator1D interpolator = new LinearInterpolator1D(); InterpolatedDoublesCurve other = CURVE.toInterpolatedDoublesCurve(x, interpolator); assertArrayEquals(other.getXDataAsPrimitive(), x, eps); assertArrayEquals(other.getYDataAsPrimitive(), y, eps); }