### Question:
RoundBufferSampleSource { public double[] getSamples() { return this.samples; } RoundBufferSampleSource(int sampleCount); void addSamples(double[] newSamples); void addSample(double newSample); double[] getSamples(); void getSamples(double[] target, int signalOffset, int count, int arrayOffset); int getSampleCount();  }### Answer:
@Test public void testGetSamples() { double target[]; target = new double[4]; source.getSamples(target, 0, 4, 0); for (int i = 0; i < 4; i++) assertEquals(target[i], 0.0, 0.0000001); source.addSamples(new double[] {1.0}); source.addSamples(new double[] {1.1}); source.addSamples(new double[] {1.2}); source.addSamples(new double[] {1.3}); target = new double[3]; source.getSamples(target, 1, 3, 0); assertEquals(target[0],1.1,0.0001); assertEquals(target[1],1.2,0.0001); assertEquals(target[2],1.3,0.0001); target = new double[5]; source.getSamples(target, 0, 4, 1); assertEquals(target[1], 1.0, 0.0001); assertEquals(target[2], 1.1, 0.0001); assertEquals(target[3], 1.2, 0.0001); assertEquals(target[4], 1.3, 0.0001); }