DoubleArraySeries extends DoubleBaseSeries { @Override public double getDouble(int index) { if (index >= size) { throw new ArrayIndexOutOfBoundsException(index); } return data[offset + index]; } DoubleArraySeries(double... data);  DoubleArraySeries(double[] data, int offset, int size); @Override int size(); @Override double getDouble(int index); @Override void copyToDouble(double[] to, int fromOffset, int toOffset, int len); @Override DoubleSeries headDouble(int len); @Override DoubleSeries tailDouble(int len); @Override DoubleSeries rangeOpenClosedDouble(int fromInclusive, int toExclusive); @Override DoubleSeries materializeDouble(); @Override double max(); @Override double min(); @Override double sum(); @Override double average(); @Override double median();  }
@Test public void testGetDouble() { DoubleArraySeries s = new DoubleArraySeries(1., 2.1); assertEquals(1, s.getDouble(0), 0.001); assertEquals(2.1, s.getDouble(1), 0.001); }
@Test public void testGetDouble_Offset() { DoubleArraySeries s = new DoubleArraySeries(new double[]{1., 2.1, 3.2, 4}, 1, 2); assertEquals(2.1, s.getDouble(0), 0.001); assertEquals(3.2, s.getDouble(1), 0.001); }
@Test public void testGetDouble_Offset_OutOfBounds() { DoubleArraySeries s = new DoubleArraySeries(new double[]{1., 2.1, 3.2, 4}, 1, 2); assertThrows(ArrayIndexOutOfBoundsException.class, () -> s.getDouble(2)); }