CommitTransaction extends AbstractThreePhaseCommitMessage { public static CommitTransaction fromSerializable(Object serializable) { Preconditions.checkArgument(serializable instanceof CommitTransaction); return (CommitTransaction)serializable; } CommitTransaction();  CommitTransaction(TransactionIdentifier transactionID, final short version); static CommitTransaction fromSerializable(Object serializable); static boolean isSerializedType(Object message);  }
@Test public void testSerialization() { CommitTransaction expected = new CommitTransaction(nextTransactionId(), DataStoreVersions.CURRENT_VERSION); Object serialized = expected.toSerializable(); assertEquals("Serialized type", CommitTransaction.class, serialized.getClass()); CommitTransaction actual = CommitTransaction.fromSerializable( SerializationUtils.clone((Serializable) serialized)); assertEquals("getTransactionID", expected.getTransactionId(), actual.getTransactionId()); assertEquals("getVersion", DataStoreVersions.CURRENT_VERSION, actual.getVersion()); }