@Test public void testCanInsert() { LookupPriorityQueue queue = new LookupPriorityQueue(2); queue.insertWithOverflow(new LookupResultItem("1", "test", 1)); queue.insertWithOverflow(new LookupResultItem("2", "test", 2)); assertFalse(queue.canInsert(0)); assertTrue(queue.canInsert(3)); }
boolean canInsert(final long score) { if (size() < maxSize) { return true; } return size() > 0 && score >= top().getScore(); }
LookupPriorityQueue extends PriorityQueue<LookupResultItem> { boolean canInsert(final long score) { if (size() < maxSize) { return true; } return size() > 0 && score >= top().getScore(); } }
LookupPriorityQueue extends PriorityQueue<LookupResultItem> { boolean canInsert(final long score) { if (size() < maxSize) { return true; } return size() > 0 && score >= top().getScore(); } LookupPriorityQueue(final int maxSize); }
LookupPriorityQueue extends PriorityQueue<LookupResultItem> { boolean canInsert(final long score) { if (size() < maxSize) { return true; } return size() > 0 && score >= top().getScore(); } LookupPriorityQueue(final int maxSize);  }
LookupPriorityQueue extends PriorityQueue<LookupResultItem> { boolean canInsert(final long score) { if (size() < maxSize) { return true; } return size() > 0 && score >= top().getScore(); } LookupPriorityQueue(final int maxSize);   }