use of org.opendaylight.yangtools.util.UnmodifiableCollection in project yangtools by opendaylight.
the class BuilderTest method immutableUserLeafSetNodeBuilderTest.
@Test
public void immutableUserLeafSetNodeBuilderTest() {
final UserLeafSetNode<String> orderedLeafSet = ImmutableUserLeafSetNodeBuilder.<String>create().withNodeIdentifier(NODE_IDENTIFIER_LEAF_LIST).withChild(LEAF_SET_ENTRY_NODE).withChildValue("baz").removeChild(BAR_PATH).build();
final LinkedList<LeafSetNode<?>> mapEntryNodeColl = new LinkedList<>();
mapEntryNodeColl.add(orderedLeafSet);
final UnmodifiableCollection<?> leafSetCollection = (UnmodifiableCollection<?>) orderedLeafSet.body();
final NormalizedNode orderedMapNodeSchemaAware = ImmutableUserLeafSetNodeBuilder.create().withNodeIdentifier(NODE_IDENTIFIER_LEAF_LIST).withChildValue("baz").build();
final UnmodifiableCollection<?> SchemaAwareleafSetCollection = (UnmodifiableCollection<?>) orderedMapNodeSchemaAware.body();
assertNotNull(Builders.anyXmlBuilder());
assertEquals(1, ((UserLeafSetNode<?>) orderedLeafSet).size());
assertEquals("baz", orderedLeafSet.childAt(0).body());
assertNull(orderedLeafSet.childByArg(BAR_PATH));
assertEquals(1, leafSetCollection.size());
assertEquals(1, SchemaAwareleafSetCollection.size());
}
Aggregations