ShardSnapshotState implements Snapshot.State { public @NonNull ShardDataTreeSnapshot getSnapshot() { return snapshot; } @VisibleForTesting  ShardSnapshotState(final @NonNull ShardDataTreeSnapshot snapshot, final boolean migrated);  ShardSnapshotState(final @NonNull ShardDataTreeSnapshot snapshot); @NonNull ShardDataTreeSnapshot getSnapshot(); @Override boolean needsMigration();  }
@Test public void testSerialization() { NormalizedNode<?, ?> expectedNode = ImmutableContainerNodeBuilder.create() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TestModel.TEST_QNAME)) .withChild(ImmutableNodes.leafNode(TestModel.DESC_QNAME, "foo")).build(); ShardSnapshotState expected = new ShardSnapshotState(new MetadataShardDataTreeSnapshot(expectedNode)); ShardSnapshotState cloned = (ShardSnapshotState) SerializationUtils.clone(expected); assertNotNull("getSnapshot is null", cloned.getSnapshot()); assertEquals("getSnapshot type", MetadataShardDataTreeSnapshot.class, cloned.getSnapshot().getClass()); assertEquals("getRootNode", expectedNode, ((MetadataShardDataTreeSnapshot)cloned.getSnapshot()).getRootNode().get()); }