### Question:
GuitarString { public void tic() { double firstItem = buffer.dequeue(); double secondItem = buffer.peek(); double newItem = (firstItem + secondItem) * 0.5 * DECAY; buffer.enqueue(newItem); } GuitarString(double frequency); void pluck(); void tic(); double sample();  }### Answer:
@Test public void testTic() { GuitarString s = new GuitarString(11025); s.pluck(); double s1 = s.sample(); s.tic(); double s2 = s.sample(); s.tic(); double s3 = s.sample(); s.tic(); double s4 = s.sample(); s.tic(); double s5 = s.sample(); double expected = 0.996 * 0.5 * (s1 + s2); assertEquals(expected, s5, 0.001); }