RobotsFactory { @Beta @Nonnull public Cache<URI, Robots> createCache() { log.debug("Initializing cache (maxSize: {}, expires after: {} hours)", config.getCacheMaxSizeRecords(), config.getCacheExpiresHours()); return CacheBuilder.newBuilder() .maximumSize(config.getCacheMaxSizeRecords()) .expireAfterWrite(config.getCacheExpiresHours(), TimeUnit.HOURS) .recordStats() .build(); } @VisibleForTesting  RobotsFactory(@Nonnull RobotsConfig config, RobotsUtilities utilities, MatcherUtils matcherUtils);  RobotsFactory(@Nonnull RobotsConfig config); @Beta @Nonnull Robots createAllowAllRobots(); @Beta @Nonnull Robots createDisallowAllRobots(); @Beta @Nonnull RobotsUtilities getUtilities(); @Nonnull @Beta RobotsLoader createLoader(); @Beta @Nonnull CharSourceSupplier createCharSourceSupplier(); @Beta @Nonnull ExpressionCompiler createPathExpressionCompiler(); @Beta @Nonnull ExpressionCompiler createAgentExpressionCompiler(); @Beta @Nonnull Cache<URI, Robots> createCache(); @Nonnull RobotsService createService(); @Beta @Nonnull RobotsBuildingParseHandler createRobotsBuildingHandler(); @Beta @Nonnull Client createClient(); @Beta @Nonnull MatcherUtils getMatcherUtils(); @Beta @Nonnull RobotsParser createRobotsParser(@Nonnull Reader reader);  }
@Test public void whenCreateCache_thenReturnsValidCache() { Cache<URI, Robots> cache = factory.createCache(); assertThat(cache, notNullValue()); }