class ClientTransaction extends AbstractClientHandle<AbstractProxyTransaction> {

    public DOMStoreThreePhaseCommitCohort ready() {
        final Collection<AbstractProxyTransaction> toReady = ensureClosed();
        Preconditions.checkState(toReady != null, "Attempted to submit a closed transaction %s", this);

        toReady.forEach(AbstractProxyTransaction::seal);
        final AbstractTransactionCommitCohort cohort;
        switch (toReady.size()) {
            case 0:
                cohort = new EmptyTransactionCommitCohort(parent(), getIdentifier());
                break;
            case 1:
                cohort = new DirectTransactionCommitCohort(parent(), getIdentifier(),
                    Iterables.getOnlyElement(toReady));
                break;
            default:
                cohort = new ClientTransactionCommitCohort(parent(), getIdentifier(), toReady);
                break;
        }

        return parent().onTransactionReady(this, cohort);
    }

      ClientTransaction(final AbstractClientHistory parent, final TransactionIdentifier transactionId);

}