### Question:
PhasingPollTable extends EntityDbTable<PhasingPoll> { public boolean isTransactionPhased(long id) throws SQLException { try (Connection con = getDatabaseManager().getDataSource().getConnection(); PreparedStatement pstmt = con.prepareStatement("select 1 from phasing_poll where id = ? UNION select 1 from phasing_poll_result where id = ?")) { pstmt.setLong(1, id); pstmt.setLong(2, id); try (ResultSet rs = pstmt.executeQuery()) { return rs.next(); } } } @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 testIsTransactionPhasedForPollId() throws SQLException { boolean phased = table.isTransactionPhased(ptd.POLL_0.getId()); assertTrue(phased); }
@Test void testIsTransactionPhasedForPollResult() throws SQLException { boolean phased = table.isTransactionPhased(ptd.RESULT_0.getId()); assertTrue(phased); }
@Test void testIsTransactionPhasedForOrdinaryTransaction() throws SQLException { boolean phased = table.isTransactionPhased(ttd.TRANSACTION_1.getId()); assertFalse(phased); }