Accumulator { public void accumulate(float... samples) { values = concat(values, samples, samples.length); } Accumulator(); void accumulateNoNaN(float... samples); void accumulate(float... samples); float[] getValues();  }
@Test public void testAccumulate() throws Exception { Accumulator acc = new Accumulator(); acc.accumulate(1, 2, 3); assertArrayEquals(new float[]{1, 2, 3}, acc.getValues(), 1E-5f); acc.accumulate(4, 5); assertArrayEquals(new float[]{1, 2, 3, 4, 5}, acc.getValues(), 1E-5f); }