### Question:
ReleaseRequestQueue { public void process(int maxIterations, Processor processor) { ListIterator<Entry> iterator = entries.listIterator(); List<Entry> toRetry = new ArrayList<>(); int i = 0; while (iterator.hasNext() && i < maxIterations) { Entry entry = iterator.next(); iterator.remove(); ++i; if (!processor.process(entry)) { toRetry.add(entry); } } entries.addAll(toRetry); } ReleaseRequestQueue(List<Entry> entries); List<Entry> getEntries(); void add(Address destination, Coin amount); void process(int maxIterations, Processor processor);  }### Answer:
@Test public void process() { class Indexer { public int index = 0; } Indexer idx = new Indexer(); queue.process(30, entry -> { Assert.assertEquals(entry, queueEntries.get(idx.index)); return idx.index++ % 2 == 0; }); Assert.assertEquals(5, idx.index); Assert.assertEquals(Arrays.asList( new ReleaseRequestQueue.Entry(mockAddress(5), Coin.COIN), new ReleaseRequestQueue.Entry(mockAddress(3), Coin.MILLICOIN) ), queue.getEntries()); }