BaseFetchJobPolicy policy = new DefaultFetchJobPolicy(maxUrlsPerSet, maxUrlsPerServer, BaseFetchJobPolicy.DEFAULT_CRAWL_DELAY);
final int crawlDelay = 10000;
policy.startFetchSet("groupingKey", crawlDelay);
FetchSetInfo setInfo = policy.nextFetchSet(new ScoredUrlDatum("url1"));
assertNotNull(setInfo);
assertEquals(1, setInfo.getUrls().size());
assertFalse(setInfo.isSkipping());
assertNull(policy.nextFetchSet(new ScoredUrlDatum("url2")));
assertNull(policy.nextFetchSet(new ScoredUrlDatum("url3")));
assertNull(policy.nextFetchSet(new ScoredUrlDatum("url4")));
assertNull(policy.nextFetchSet(new ScoredUrlDatum("url5")));
setInfo = policy.endFetchSet();
assertNotNull(setInfo);
assertEquals(4, setInfo.getUrls().size());
assertTrue(setInfo.isSkipping());