Trim extends SynchronousProcessor { private Trim() { super(1, 1); m_delay = 0; } private  Trim();  Trim(int delay); @Override Trim duplicate(boolean with_state); int getDelay();  }
@Test public void testTrim() { Trim d = new Trim(3); QueueSink qs = new QueueSink(1); Connector.connect(d, qs); Pushable in = d.getPushableInput(0); Queue<Object> queue = qs.getQueue(0); for (int k = 0; k < 2; k++) { in.push(0); assertTrue(queue.isEmpty()); in.push(1); assertTrue(queue.isEmpty()); in.push(2); assertTrue(queue.isEmpty()); in.push(3); Utilities.queueContains(3, queue); in.push(4); Utilities.queueContains(4, queue); d.reset(); } }