DiskQueue extends AbstractQueue<String> { @Override public String poll() { loadMemoryQueue(); return memoryQueue.poll(); } DiskQueue(int maxInMemorySize);  DiskQueue(int maxInMemorySize, File tempDir); @Override Iterator<String> iterator(); @Override int size(); @Override boolean offer(String element); @Override String peek(); @Override String remove(); @Override String poll(); @Override void clear();  }
@Test public void testPoll() { Queue<String> instance = new DiskQueue<String>(1); String element = "testPoll"; instance.add(element); Object result = instance.poll(); assertEquals(element, result); }
@Test public void testPoll_whenEmpty() { DiskQueue<String> instance = new DiskQueue<String>(1); Object result = instance.poll(); assertNull(result); }