private URLContentManager createURLContentManager(final SystemClock clock,
final Period timeout, final boolean cacheable, final int maxCount) {
Cache cache = null;
if (cacheable) {
final CacheBuilder cacheBuilder =
CacheFactory.getDefaultInstance().createCacheBuilder();
cacheBuilder.setMaxCount(maxCount);
cacheBuilder.setClock(clock);
cacheBuilder.setExpirationChecker(new URLContentValidationChecker());
cache = cacheBuilder.buildCache();
}
final URLContentManagerConfiguration config =
new URLContentManagerConfiguration();
config.setDefaultTimeout(timeout);