public boolean isRunning() {
        return transactionStatus == TransactionStatus.PREPARE || transactionStatus == TransactionStatus.PREPARED ||
                transactionStatus == TransactionStatus.COMMITTED;
    }
@Test
    public void testIsRunning() {
        Set<TransactionStatus> nonRunningStatus = new HashSet<>();
        nonRunningStatus.add(TransactionStatus.UNKNOWN);
        nonRunningStatus.add(TransactionStatus.VISIBLE);
        nonRunningStatus.add(TransactionStatus.ABORTED);

        UUID uuid = UUID.randomUUID();
        for (TransactionStatus status : TransactionStatus.values()) {
            TransactionState transactionState = new TransactionState(1000L, Lists.newArrayList(20000L, 20001L),
                    3000, "label123", new TUniqueId(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits()),
                    LoadJobSourceType.BACKEND_STREAMING, new TxnCoordinator(TxnSourceType.BE, "127.0.0.1"), 50000L,
                    60 * 1000L);
            transactionState.setTransactionStatus(status);
            Assert.assertEquals(nonRunningStatus.contains(status), !transactionState.isRunning());
        }
    }