### Question:
PhasingPollTable extends EntityDbTable<PhasingPoll> { public List<TransactionDbInfo> getActivePhasedTransactionDbIds(int height) throws SQLException { List<TransactionDbInfo> excludeInfos = new ArrayList<>(); TransactionalDataSource dataSource = databaseManager.getDataSource(); try (Connection conn = dataSource.getConnection(); PreparedStatement pstmt = conn.prepareStatement( "SELECT db_id, id FROM transaction WHERE id IN " + "(SELECT id FROM phasing_poll WHERE height < ? AND id not in " + "(SELECT id FROM phasing_poll_result WHERE height <= ?))")) { pstmt.setInt(1, height); pstmt.setInt(2, height); try (ResultSet rs = pstmt.executeQuery()) { while (rs.next()) { excludeInfos.add(new TransactionDbInfo(rs.getLong("db_id"), rs.getLong("id"))); } } } return excludeInfos; } @Inject  PhasingPollTable(Blockchain blockchain); @Override PhasingPoll load(Connection con, ResultSet rs, DbKey dbKey); PhasingPoll get(long id); @Override void save(Connection con, PhasingPoll poll); List<Transaction> getFinishingTransactions(int height); List<Transaction> getFinishingTransactionsByTime(int startTime, int finishTime); long getSenderPhasedTransactionFees(long accountId, int height); DbIterator<Transaction> getHoldingPhasedTransactions(long holdingId, VoteWeighting.VotingModel votingModel,
                                                                long accountId, boolean withoutWhitelist, int from, int to, int height); DbIterator<Transaction> getAccountPhasedTransactions(long accountId, int from, int to, int height); int getAccountPhasedTransactionCount(long accountId, int height); int getAllPhasedTransactionsCount(); List<TransactionDbInfo> getActivePhasedTransactionDbIds(int height); boolean isTransactionPhased(long id); @Override void trim(int height);  }### Answer:
@Test void testGetActivePhasingDbIds() throws SQLException { List<TransactionDbInfo> transactionDbInfoList = table.getActivePhasedTransactionDbIds(ttd.TRANSACTION_8.getHeight() + 1); assertEquals(Arrays.asList(new TransactionDbInfo(ttd.DB_ID_8, ttd.TRANSACTION_8.getId()), new TransactionDbInfo(ttd.DB_ID_7, ttd.TRANSACTION_7.getId())), transactionDbInfoList); }
@Test void testGetActivePhasingDbIdWhenHeightIsMax() throws SQLException { List<TransactionDbInfo> transactionDbInfoList = table.getActivePhasedTransactionDbIds(Integer.MAX_VALUE); assertEquals(Arrays.asList(new TransactionDbInfo(ttd.DB_ID_12, ttd.TRANSACTION_12.getId()), new TransactionDbInfo(ttd.DB_ID_11, ttd.TRANSACTION_11.getId()), new TransactionDbInfo(ttd.DB_ID_13, ttd.TRANSACTION_13.getId())), transactionDbInfoList); }
@Test void testGetActivePhasingDbIdAllPollsFinished() throws SQLException { List<TransactionDbInfo> transactionDbInfoList = table.getActivePhasedTransactionDbIds(ptd.POLL_0.getHeight() - 1); assertEquals(Collections.emptyList(), transactionDbInfoList); }
@Test void testGetActivePhasingDbIdsWhenNoPollsAtHeight() throws SQLException { List<TransactionDbInfo> transactionDbInfoList = table.getActivePhasedTransactionDbIds(ttd.TRANSACTION_0.getHeight()); assertEquals(Collections.emptyList(), transactionDbInfoList); }