### Question:
RoundBufferSampleSource { public void addSamples(double[] newSamples) { for (int i = 0; i < newSamples.length; i++) { samples[nextInsertPos] = newSamples[i]; incrNextInsertPos(); } } 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 testAddSamples() { source.addSamples(new double[] {1.0}); source.addSamples(new double[] {1.1}); source.addSamples(new double[] {1.2}); source.addSamples(new double[] {1.3}); source.addSamples(new double[] {1.4}); source.addSamples(new double[] {1.5}); double[] theSamples=source.getSamples(); assertEquals(theSamples[0],1.4, 0.00001); assertEquals(theSamples[1],1.5, 0.00001); assertEquals(theSamples[2],1.2, 0.00001); assertEquals(theSamples[3],1.3, 0.00001); }