@Test public void testImmediatePickup() throws InterruptedException { addTraces(2); Assert.assertEquals(expected, queue.consume()); }
public List<Span> consume() throws InterruptedException { List<Span> rc; synchronized (this) { while (spans == null) { wait(); } rc = spans; spans = null; } return rc; }
TraceQueue { public List<Span> consume() throws InterruptedException { List<Span> rc; synchronized (this) { while (spans == null) { wait(); } rc = spans; spans = null; } return rc; } }
TraceQueue { public List<Span> consume() throws InterruptedException { List<Span> rc; synchronized (this) { while (spans == null) { wait(); } rc = spans; spans = null; } return rc; }  }
TraceQueue { public List<Span> consume() throws InterruptedException { List<Span> rc; synchronized (this) { while (spans == null) { wait(); } rc = spans; spans = null; } return rc; }  void supply(Span span); List<Span> consume(); }
TraceQueue { public List<Span> consume() throws InterruptedException { List<Span> rc; synchronized (this) { while (spans == null) { wait(); } rc = spans; spans = null; } return rc; }  void supply(Span span); List<Span> consume();  }