### Question:
BlockStore { public synchronized void releaseRange(long from, long to) { for (long k = from; k <= to; k++) { for (Block b : this.getBlocksByNumber(k)) { this.removeBlock(b); } } }  synchronized void saveBlock(Block block); synchronized void removeBlock(Block block); synchronized Block getBlockByHash(byte[] hash); synchronized List<Block> getBlocksByNumber(long number); synchronized List<Block> getBlocksByParentHash(Keccak256 hash); List<Block> getChildrenOf(Set<Block> blocks); synchronized boolean hasBlock(Block block); synchronized boolean hasBlock(byte[] hash); synchronized int size(); synchronized long minimalHeight(); synchronized long maximumHeight(); synchronized void releaseRange(long from, long to); synchronized boolean hasHeader(Keccak256 hash); synchronized void saveHeader(@Nonnull final BlockHeader header); synchronized void removeHeader(@Nonnull final BlockHeader header);  }### Answer:
@Test public void releaseRange() { BlockStore store = new BlockStore(); final BlockGenerator generator = new BlockGenerator(); Block genesis = generator.getGenesisBlock(); List<Block> blocks1 = generator.getBlockChain(genesis, 1000); List<Block> blocks2 = generator.getBlockChain(genesis, 1000); for (Block b : blocks1) store.saveBlock(b); for (Block b : blocks2) store.saveBlock(b); Assert.assertEquals(2000, store.size()); store.releaseRange(1, 1000); Assert.assertEquals(0, store.size()); }