### Question:
CollectionNode extends Node { void setAssociationPolicy(LeafNodeAssociationPolicy associationPolicy) { this.associationPolicy = associationPolicy; } CollectionNode( PubSubService.UniqueIdentifier serviceId, CollectionNode parentNode, String nodeID, JID creator, boolean subscriptionEnabled, boolean deliverPayloads, boolean notifyConfigChanges, boolean notifyDelete, boolean notifyRetract, boolean presenceBasedDelivery, AccessModel accessModel, PublisherModel publisherModel, String language, ItemReplyPolicy replyPolicy, LeafNodeAssociationPolicy associationPolicy, int maxLeafNodes);  CollectionNode( PubSubService.UniqueIdentifier serviceId, CollectionNode parentNode, String nodeID, JID creator, DefaultNodeConfiguration defaultConfiguration);  CollectionNode(); @Override boolean isCollectionNode(); @Override boolean isChildNode(Node child); @Override boolean isDescendantNode(Node child); @Override Collection<Node> getNodes(); LeafNodeAssociationPolicy getAssociationPolicy(); Collection<JID> getAssociationTrusted(); int getMaxLeafNodes(); boolean isAssociationAllowed(JID user); boolean isMaxLeafNodeReached(); @Override int getCachedSize(); @Override void writeExternal( ObjectOutput out ); @Override void readExternal( ObjectInput in );  }### Answer:
@Test public void testSerialization() throws Exception { final DefaultNodeConfiguration config = new DefaultNodeConfiguration(false); config.setDeliverPayloads( !config.isDeliverPayloads() ); config.setMaxPayloadSize( 98732 ); config.setPersistPublishedItems( !config.isPersistPublishedItems() ); config.setMaxPublishedItems( 13461 ); config.setNotifyConfigChanges( !config.isNotifyConfigChanges()); config.setNotifyDelete( !config.isNotifyDelete() ); config.setNotifyRetract( !config.isNotifyRetract() ); config.setPresenceBasedDelivery( !config.isPresenceBasedDelivery() ); config.setSendItemSubscribe( !config.isSendItemSubscribe() ); config.setPublisherModel(PublisherModel.subscribers ); config.setSubscriptionEnabled( !config.isSubscriptionEnabled() ); config.setAccessModel(AccessModel.whitelist ); config.setLanguage( "nl_NL" ); config.setReplyPolicy(Node.ItemReplyPolicy.publisher ); config.setAssociationPolicy(CollectionNode.LeafNodeAssociationPolicy.whitelist ); final CollectionNode input = new CollectionNode( new PubSubService.UniqueIdentifier( "test-service-id" ), null, "test-node-id", new JID( "unit-test@example.org"), config); final Object result = serializeAndDeserialize( input ); assertNotNull( result ); assertTrue( result instanceof CollectionNode ); assertEquals( input, result ); }