### Question:
PhasingPollTable extends EntityDbTable<PhasingPoll> { public DbIterator<Transaction> getHoldingPhasedTransactions(long holdingId, VoteWeighting.VotingModel votingModel, long accountId, boolean withoutWhitelist, int from, int to, int height) throws SQLException { Connection con = null; try { con = getDatabaseManager().getDataSource().getConnection(); PreparedStatement pstmt = con.prepareStatement("SELECT transaction.* " + "FROM transaction, phasing_poll " + "WHERE phasing_poll.holding_id = ? " + "AND phasing_poll.voting_model = ? " + "AND phasing_poll.id = transaction.id " + "AND phasing_poll.finish_height > ? " + (accountId != 0 ? "AND phasing_poll.account_id = ? " : "") + (withoutWhitelist ? "AND phasing_poll.whitelist_size = 0 " : "") + "ORDER BY transaction.height DESC, transaction.transaction_index DESC " + DbUtils.limitsClause(from, to)); int i = 0; pstmt.setLong(++i, holdingId); pstmt.setByte(++i, votingModel.getCode()); pstmt.setInt(++i, height); if (accountId != 0) { pstmt.setLong(++i, accountId); } DbUtils.setLimits(++i, pstmt, from, to); return blockchain.getTransactions(con, pstmt); } catch (SQLException e) { DbUtils.close(con); throw e; } } @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 testGetByHoldingId() throws SQLException { List<Transaction> transactions = CollectionUtil.toList(table.getHoldingPhasedTransactions(ptd.POLL_5.getVoteWeighting().getHoldingId(), VoteWeighting.VotingModel.ASSET, 0, false, 0, 100, ptd.POLL_5.getHeight())); assertEquals(List.of(ttd.TRANSACTION_13), transactions); }
@Test void testGetByHoldingIdNotExist() throws SQLException { List<Transaction> transactions = CollectionUtil.toList(table.getHoldingPhasedTransactions(ptd.POLL_4.getVoteWeighting().getHoldingId(), VoteWeighting.VotingModel.ACCOUNT, 0, false, 0, 100, ptd.POLL_5.getHeight())); assertTrue(transactions.isEmpty()); }