### Question:
BlockManagerImpl implements BlockManager { @Override public List<BlockData> listBlock(Container container, long startLocalID, int count) throws IOException { Preconditions.checkNotNull(container, "container cannot be null"); Preconditions.checkState(startLocalID >= 0, "startLocal ID cannot be " + "negative"); Preconditions.checkArgument(count > 0, "Count must be a positive number."); container.readLock(); try { List<BlockData> result = null; KeyValueContainerData cData = (KeyValueContainerData) container.getContainerData(); try (ReferenceCountedDB db = BlockUtils.getDB(cData, config)) { result = new ArrayList<>(); List<? extends Table.KeyValue<String, BlockData>> range = db.getStore().getBlockDataTable() .getSequentialRangeKVs(Long.toString(startLocalID), count, MetadataKeyFilters.getUnprefixedKeyFilter()); for (Table.KeyValue<String, BlockData> entry: range) { BlockData data = new BlockData(entry.getValue().getBlockID()); result.add(data); } return result; } } finally { container.readUnlock(); } } BlockManagerImpl(ConfigurationSource conf); long putBlock(Container container, BlockData data); long putBlock(Container container, BlockData data,
      boolean incrKeyCount); @Override BlockData getBlock(Container container, BlockID blockID); @Override long getCommittedBlockLength(Container container, BlockID blockID); void deleteBlock(Container container, BlockID blockID); @Override List<BlockData> listBlock(Container container, long startLocalID, int
      count); void shutdown();  }### Answer:
@Test public void testListBlock() throws Exception { blockManager.putBlock(keyValueContainer, blockData); List<BlockData> listBlockData = blockManager.listBlock( keyValueContainer, 1, 10); assertNotNull(listBlockData); assertTrue(listBlockData.size() == 1); for (long i = 2; i <= 10; i++) { blockID = new BlockID(1L, i); blockData = new BlockData(blockID); blockData.addMetadata(OzoneConsts.VOLUME, OzoneConsts.OZONE); blockData.addMetadata(OzoneConsts.OWNER, OzoneConsts.OZONE_SIMPLE_HDFS_USER); List<ContainerProtos.ChunkInfo> chunkList = new ArrayList<>(); ChunkInfo info = new ChunkInfo(String.format("%d.data.%d", blockID .getLocalID(), 0), 0, 1024); chunkList.add(info.getProtoBufMessage()); blockData.setChunks(chunkList); blockManager.putBlock(keyValueContainer, blockData); } listBlockData = blockManager.listBlock( keyValueContainer, 1, 10); assertNotNull(listBlockData); assertTrue(listBlockData.size() == 10); }