### Question:
TransactionLogBloomCacher { void cacheAll() { ensurePreviousSegmentsArePresent(blockchain.getChainHeadBlockNumber(), false); } TransactionLogBloomCacher(
      final Blockchain blockchain, final Path cacheDir, final EthScheduler scheduler); CachingStatus getCachingStatus(); CachingStatus generateLogBloomCache(final long start, final long stop); void removeSegments(final Long startBlock, final Long stopBlock); void ensurePreviousSegmentsArePresent(
      final long blockNumber, final boolean overrideCacheCheck); CachingStatus requestCaching(final long fromBlock, final long toBlock); static final int BLOCKS_PER_BLOOM_CACHE; static final int BLOOM_BITS_LENGTH; static final String CURRENT; }### Answer:
@Test public void shouldSplitLogsIntoSeveralFiles() { when(blockchain.getChainHeadBlockNumber()).thenReturn(200003L); assertThat(cacheDir.getRoot().list().length).isEqualTo(0); transactionLogBloomCacher.cacheAll(); assertThat(cacheDir.getRoot().list().length).isEqualTo(2); }
@Test public void shouldReloadCacheWhenFileIsInvalid() throws IOException { final File logBloom = cacheDir.newFile("logBloom-0.cache"); final File logBloom1 = cacheDir.newFile("logBloom-1.cache"); when(blockchain.getChainHeadBlockNumber()).thenReturn(100003L); assertThat(logBloom.length()).isEqualTo(0); assertThat(logBloom1.length()).isEqualTo(0); assertThat(cacheDir.getRoot().list().length).isEqualTo(2); transactionLogBloomCacher.cacheAll(); assertThat(logBloom.length()).isEqualTo(BLOOM_BITS_LENGTH * BLOCKS_PER_BLOOM_CACHE); assertThat(logBloom1.length()).isEqualTo(0); assertThat(cacheDir.getRoot().list().length).isEqualTo(2); }