### Question:
PrevBlockInfoExtractor { public PrevBlockData extractPrevBlockData(int height, int limit) { return PrevBlockData.builder() .generatorIds(Convert.toObjectLongArray(extractObjects(height, limit, "generator_id"))) .prevBlockTimeouts(Convert.toObjectIntArray(extractObjects(height, limit, "timeout"))) .prevBlockTimestamps(Convert.toObjectIntArray(extractObjects(height, limit, "timestamp"))) .build(); } @Inject  PrevBlockInfoExtractor(DatabaseManager databaseManager); PrevBlockData extractPrevBlockData(int height, int limit);  }### Answer:
@Test void testGetIdsBeforeGenesisHeight() { PrevBlockData prevBlockData = extractor.extractPrevBlockData(0, Integer.MAX_VALUE); assertEquals(0, prevBlockData.getGeneratorIds().length); assertEquals(0, prevBlockData.getPrevBlockTimeouts().length); assertEquals(0, prevBlockData.getPrevBlockTimestamps().length); }
@Test void testGetIdsBeforeLastBlockHeight() { PrevBlockData prevBlockData = extractor.extractPrevBlockData(BlockTestData.BLOCK_10_HEIGHT, 3); assertArrayEquals(new Long[]{BlockTestData.BLOCK_9_GENERATOR, BlockTestData.BLOCK_8_GENERATOR, BlockTestData.BLOCK_7_GENERATOR}, prevBlockData.getGeneratorIds()); assertArrayEquals(new Integer[]{BlockTestData.BLOCK_9_TIMESTAMP, BlockTestData.BLOCK_8_TIMESTAMP, BlockTestData.BLOCK_7_TIMESTAMP}, prevBlockData.getPrevBlockTimestamps()); assertArrayEquals(new Integer[]{BlockTestData.BLOCK_9_TIMEOUT, BlockTestData.BLOCK_8_TIMEOUT, BlockTestData.BLOCK_7_TIMEOUT}, prevBlockData.getPrevBlockTimeouts()); }