@Test public void testFind() { Object a = new Object(); Object b = new Object(); Object c = new Object(); queue.enqueue(a); queue.enqueue(b); queue.enqueue(c); assertEquals(3, queue.size()); assertSame(a, queue.find(a)); assertSame(b, queue.find(b)); assertSame(c, queue.find(c)); assertEquals(3, queue.size()); }
public Object find(Object obj) { synchronized (mutex) { Object current; ListIterator<Object> iter = queueData.listIterator(0); while (iter.hasNext()) { current = iter.next(); if (current.equals(obj)) { return current; } } } return null; }
Queue extends SmppObject { public Object find(Object obj) { synchronized (mutex) { Object current; ListIterator<Object> iter = queueData.listIterator(0); while (iter.hasNext()) { current = iter.next(); if (current.equals(obj)) { return current; } } } return null; } }
Queue extends SmppObject { public Object find(Object obj) { synchronized (mutex) { Object current; ListIterator<Object> iter = queueData.listIterator(0); while (iter.hasNext()) { current = iter.next(); if (current.equals(obj)) { return current; } } } return null; } Queue();  Queue(int maxSize); }
Queue extends SmppObject { public Object find(Object obj) { synchronized (mutex) { Object current; ListIterator<Object> iter = queueData.listIterator(0); while (iter.hasNext()) { current = iter.next(); if (current.equals(obj)) { return current; } } } return null; } Queue();  Queue(int maxSize); int size(); boolean isEmpty(); Object dequeue(); Object dequeue(Object obj); void enqueue(Object obj); Object find(Object obj); }
Queue extends SmppObject { public Object find(Object obj) { synchronized (mutex) { Object current; ListIterator<Object> iter = queueData.listIterator(0); while (iter.hasNext()) { current = iter.next(); if (current.equals(obj)) { return current; } } } return null; } Queue();  Queue(int maxSize); int size(); boolean isEmpty(); Object dequeue(); Object dequeue(Object obj); void enqueue(Object obj); Object find(Object obj);  }