BUG-4688: eliminate SimpleDateFormatUtil.DEFAULT_DATE_REV
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / IfFeatureResolutionTest.java
index c26cb5ab5ab816c34757ab3c31e488ce114e4f06..b49fec820c7f846398e52a045ede2ade368547ab 100644 (file)
@@ -11,10 +11,10 @@ package org.opendaylight.yangtools.yang.stmt;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.sourceForResource;
 
-import java.util.HashSet;
+import com.google.common.collect.ImmutableSet;
 import java.util.Set;
-import java.util.function.Predicate;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.AnyXmlSchemaNode;
@@ -26,116 +26,108 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangStatementSourceImpl;
 
 public class IfFeatureResolutionTest {
 
-    private static final StatementStreamSource FOO_MODULE =
-            new YangStatementSourceImpl("/if-feature-resolution-test/foo.yang", false);
-    private static final StatementStreamSource BAR_MODULE =
-            new YangStatementSourceImpl("/if-feature-resolution-test/bar.yang", false);
+    private static final StatementStreamSource FOO_MODULE = sourceForResource("/if-feature-resolution-test/foo.yang");
+    private static final StatementStreamSource BAR_MODULE = sourceForResource("/if-feature-resolution-test/bar.yang");
 
     @Test
     public void testSomeFeaturesSupported() throws ReactorException {
-        Predicate<QName> isFeatureSupported = qName -> {
-            Set<QName> supportedFeatures = new HashSet<>();
-            supportedFeatures.add(QName.create("foo-namespace", "1970-01-01", "test-feature-1"));
-            supportedFeatures.add(QName.create("foo-namespace", "1970-01-01", "test-feature-2"));
-            supportedFeatures.add(QName.create("foo-namespace", "1970-01-01", "test-feature-3"));
-            supportedFeatures.add(QName.create("bar-namespace", "1970-01-01", "imp-feature"));
+        final Set<QName> supportedFeatures = ImmutableSet.of(
+                QName.create("foo-namespace", "test-feature-1"),
+                QName.create("foo-namespace", "test-feature-2"),
+                QName.create("foo-namespace", "test-feature-3"),
+                QName.create("bar-namespace", "imp-feature"));
 
-            return supportedFeatures.contains(qName);
-        };
-
-        CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild(isFeatureSupported);
+        final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(FOO_MODULE, BAR_MODULE);
+        reactor.setSupportedFeatures(supportedFeatures);
 
-        SchemaContext schemaContext = reactor.buildEffective();
+        final SchemaContext schemaContext = reactor.buildEffective();
         assertNotNull(schemaContext);
 
-        Module testModule = schemaContext.findModuleByName("foo", null);
-        assertNotNull(testModule);
-
+        final Module testModule = schemaContext.findModule("foo", null).get();
         assertEquals(9, testModule.getChildNodes().size());
 
-        ContainerSchemaNode testContainerA = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerA = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-a"));
         assertNull(testContainerA);
 
-        ContainerSchemaNode testContainerB = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerB = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-b"));
         assertNotNull(testContainerB);
-        LeafSchemaNode testLeafB = (LeafSchemaNode) testContainerB.getDataChildByName(
+        final LeafSchemaNode testLeafB = (LeafSchemaNode) testContainerB.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-b"));
         assertNotNull(testLeafB);
 
-        ContainerSchemaNode testContainerC = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerC = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-c"));
         assertNotNull(testContainerC);
-        LeafSchemaNode testLeafC = (LeafSchemaNode) testContainerC.getDataChildByName(
+        final LeafSchemaNode testLeafC = (LeafSchemaNode) testContainerC.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-c"));
         assertNotNull(testLeafC);
 
-        ContainerSchemaNode testContainerD = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerD = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-d"));
         assertNull(testContainerD);
 
-        ContainerSchemaNode testContainerE = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerE = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-e"));
         assertNotNull(testContainerE);
-        ContainerSchemaNode testSubContainerE = (ContainerSchemaNode) testContainerE.getDataChildByName(
+        final ContainerSchemaNode testSubContainerE = (ContainerSchemaNode) testContainerE.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-subcontainer-e"));
         assertNotNull(testSubContainerE);
-        LeafSchemaNode testLeafE = (LeafSchemaNode) testSubContainerE.getDataChildByName(
+        final LeafSchemaNode testLeafE = (LeafSchemaNode) testSubContainerE.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-e"));
         assertNull(testLeafE);
 
-        ContainerSchemaNode testContainerF = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerF = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-f"));
         assertNotNull(testContainerF);
-        ContainerSchemaNode testSubContainerF = (ContainerSchemaNode) testContainerF.getDataChildByName(
+        final ContainerSchemaNode testSubContainerF = (ContainerSchemaNode) testContainerF.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-subcontainer-f"));
         assertNull(testSubContainerF);
 
-        ContainerSchemaNode testContainerG = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerG = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-g"));
         assertNotNull(testContainerG);
         assertEquals(1, testContainerG.getAvailableAugmentations().size());
-        LeafSchemaNode testLeafG = (LeafSchemaNode) testContainerG.getDataChildByName(
+        final LeafSchemaNode testLeafG = (LeafSchemaNode) testContainerG.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-g"));
         assertNotNull(testLeafG);
-        LeafSchemaNode augmentingTestLeafG = (LeafSchemaNode) testContainerG.getDataChildByName(
+        final LeafSchemaNode augmentingTestLeafG = (LeafSchemaNode) testContainerG.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "augmenting-test-leaf-g"));
         assertNull(augmentingTestLeafG);
-        AnyXmlSchemaNode augmentingTestAnyxmlG = (AnyXmlSchemaNode) testContainerG.getDataChildByName(
+        final AnyXmlSchemaNode augmentingTestAnyxmlG = (AnyXmlSchemaNode) testContainerG.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "augmenting-test-anyxml-g"));
         assertNotNull(augmentingTestAnyxmlG);
 
-        ContainerSchemaNode testContainerH = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerH = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-h"));
         assertNotNull(testContainerH);
         assertEquals(0, testContainerH.getChildNodes().size());
         assertEquals(0, testContainerH.getUses().size());
 
-        ContainerSchemaNode testContainerI = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerI = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-i"));
         assertNotNull(testContainerI);
         assertEquals(1, testContainerI.getUses().size());
         ContainerSchemaNode testGroupingSubContainer = (ContainerSchemaNode) testContainerI.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-grouping-subcontainer"));
         assertNotNull(testGroupingSubContainer);
-        LeafSchemaNode testGroupingLeaf = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
+        final LeafSchemaNode testGroupingLeaf = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-grouping-leaf"));
         assertNull(testGroupingLeaf);
 
-        ContainerSchemaNode testContainerJ = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerJ = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-j"));
         assertNotNull(testContainerJ);
-        LeafSchemaNode testLeafJ = (LeafSchemaNode) testContainerJ.getDataChildByName(
+        final LeafSchemaNode testLeafJ = (LeafSchemaNode) testContainerJ.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-j"));
         assertNotNull(testLeafJ);
 
-        ContainerSchemaNode testContainerK = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerK = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-k"));
         assertNotNull(testContainerK);
         assertEquals(1, testContainerK.getUses().size());
@@ -143,94 +135,94 @@ public class IfFeatureResolutionTest {
                 QName.create(testModule.getQNameModule(), "test-grouping-subcontainer"));
         assertNotNull(testGroupingSubContainer);
         assertEquals(1, testGroupingSubContainer.getAvailableAugmentations().size());
-        LeafSchemaNode augmentingTestGroupingLeaf = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
+        final LeafSchemaNode augmentingTestGroupingLeaf = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "augmenting-test-grouping-leaf"));
         assertNotNull(augmentingTestGroupingLeaf);
-        LeafSchemaNode augmentingTestGroupingLeaf2 = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
+        final LeafSchemaNode augmentingTestGroupingLeaf2 = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "augmenting-test-grouping-leaf-2"));
         assertNull(augmentingTestGroupingLeaf2);
     }
 
     @Test
     public void testAllFeaturesSupported() throws ReactorException {
-        CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
+        final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(FOO_MODULE, BAR_MODULE);
 
-        SchemaContext schemaContext = reactor.buildEffective();
+        final SchemaContext schemaContext = reactor.buildEffective();
         assertNotNull(schemaContext);
 
-        Module testModule = schemaContext.findModuleByName("foo", null);
+        final Module testModule = schemaContext.findModules("foo").iterator().next();
         assertNotNull(testModule);
 
         assertEquals(11, testModule.getChildNodes().size());
 
-        ContainerSchemaNode testContainerA = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerA = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-a"));
         assertNotNull(testContainerA);
-        LeafSchemaNode testLeafA = (LeafSchemaNode) testContainerA.getDataChildByName(
+        final LeafSchemaNode testLeafA = (LeafSchemaNode) testContainerA.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-a"));
         assertNotNull(testLeafA);
 
 
-        ContainerSchemaNode testContainerB = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerB = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-b"));
         assertNotNull(testContainerB);
-        LeafSchemaNode testLeafB = (LeafSchemaNode) testContainerB.getDataChildByName(
+        final LeafSchemaNode testLeafB = (LeafSchemaNode) testContainerB.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-b"));
         assertNotNull(testLeafB);
 
-        ContainerSchemaNode testContainerC = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerC = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-c"));
         assertNotNull(testContainerC);
-        LeafSchemaNode testLeafC = (LeafSchemaNode) testContainerC.getDataChildByName(
+        final LeafSchemaNode testLeafC = (LeafSchemaNode) testContainerC.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-c"));
         assertNotNull(testLeafC);
 
-        ContainerSchemaNode testContainerD = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerD = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-d"));
         assertNotNull(testContainerD);
-        LeafSchemaNode testLeafD = (LeafSchemaNode) testContainerD.getDataChildByName(
+        final LeafSchemaNode testLeafD = (LeafSchemaNode) testContainerD.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-d"));
         assertNotNull(testLeafD);
 
-        ContainerSchemaNode testContainerE = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerE = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-e"));
         assertNotNull(testContainerE);
-        ContainerSchemaNode testSubContainerE = (ContainerSchemaNode) testContainerE.getDataChildByName(
+        final ContainerSchemaNode testSubContainerE = (ContainerSchemaNode) testContainerE.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-subcontainer-e"));
         assertNotNull(testSubContainerE);
-        LeafSchemaNode testLeafE = (LeafSchemaNode) testSubContainerE.getDataChildByName(
+        final LeafSchemaNode testLeafE = (LeafSchemaNode) testSubContainerE.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-e"));
         assertNotNull(testLeafE);
 
-        ContainerSchemaNode testContainerF = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerF = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-f"));
         assertNotNull(testContainerF);
-        ContainerSchemaNode testSubContainerF = (ContainerSchemaNode) testContainerF.getDataChildByName(
+        final ContainerSchemaNode testSubContainerF = (ContainerSchemaNode) testContainerF.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-subcontainer-f"));
         assertNotNull(testSubContainerF);
-        ContainerSchemaNode testSubSubContainerF = (ContainerSchemaNode) testSubContainerF.getDataChildByName(
+        final ContainerSchemaNode testSubSubContainerF = (ContainerSchemaNode) testSubContainerF.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-subsubcontainer-f"));
         assertNotNull(testSubSubContainerF);
-        LeafSchemaNode testLeafF = (LeafSchemaNode) testSubSubContainerF.getDataChildByName(
+        final LeafSchemaNode testLeafF = (LeafSchemaNode) testSubSubContainerF.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-f"));
         assertNotNull(testLeafF);
 
-        ContainerSchemaNode testContainerG = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerG = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-g"));
         assertNotNull(testContainerG);
         assertEquals(2, testContainerG.getAvailableAugmentations().size());
-        LeafSchemaNode testLeafG = (LeafSchemaNode) testContainerG.getDataChildByName(
+        final LeafSchemaNode testLeafG = (LeafSchemaNode) testContainerG.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-g"));
         assertNotNull(testLeafG);
-        LeafSchemaNode augmentingTestLeafG = (LeafSchemaNode) testContainerG.getDataChildByName(
+        final LeafSchemaNode augmentingTestLeafG = (LeafSchemaNode) testContainerG.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "augmenting-test-leaf-g"));
         assertNotNull(augmentingTestLeafG);
-        AnyXmlSchemaNode augmentingTestAnyxmlG = (AnyXmlSchemaNode) testContainerG.getDataChildByName(
+        final AnyXmlSchemaNode augmentingTestAnyxmlG = (AnyXmlSchemaNode) testContainerG.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "augmenting-test-anyxml-g"));
         assertNotNull(augmentingTestAnyxmlG);
 
-        ContainerSchemaNode testContainerH = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerH = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-h"));
         assertNotNull(testContainerH);
         assertEquals(1, testContainerH.getUses().size());
@@ -241,7 +233,7 @@ public class IfFeatureResolutionTest {
                 QName.create(testModule.getQNameModule(), "test-grouping-leaf"));
         assertNotNull(testGroupingLeaf);
 
-        ContainerSchemaNode testContainerI = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerI = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-i"));
         assertNotNull(testContainerI);
         assertEquals(1, testContainerI.getUses().size());
@@ -252,14 +244,14 @@ public class IfFeatureResolutionTest {
                 QName.create(testModule.getQNameModule(), "test-grouping-leaf"));
         assertNotNull(testGroupingLeaf);
 
-        ContainerSchemaNode testContainerJ = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerJ = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-j"));
         assertNotNull(testContainerJ);
-        LeafSchemaNode testLeafJ = (LeafSchemaNode) testContainerJ.getDataChildByName(
+        final LeafSchemaNode testLeafJ = (LeafSchemaNode) testContainerJ.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-j"));
         assertNotNull(testLeafJ);
 
-        ContainerSchemaNode testContainerK = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerK = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-k"));
         assertNotNull(testContainerK);
         assertEquals(1, testContainerK.getUses().size());
@@ -267,10 +259,10 @@ public class IfFeatureResolutionTest {
                 QName.create(testModule.getQNameModule(), "test-grouping-subcontainer"));
         assertNotNull(testGroupingSubContainer);
         assertEquals(1, testGroupingSubContainer.getAvailableAugmentations().size());
-        LeafSchemaNode augmentingTestGroupingLeaf = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
+        final LeafSchemaNode augmentingTestGroupingLeaf = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "augmenting-test-grouping-leaf"));
         assertNotNull(augmentingTestGroupingLeaf);
-        LeafSchemaNode augmentingTestGroupingLeaf2 = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
+        final LeafSchemaNode augmentingTestGroupingLeaf2 = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "augmenting-test-grouping-leaf-2"));
         assertNotNull(augmentingTestGroupingLeaf2);
         testGroupingLeaf = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
@@ -280,57 +272,56 @@ public class IfFeatureResolutionTest {
 
     @Test
     public void testNoFeaturesSupported() throws ReactorException {
-        Predicate<QName> isFeatureSupported = qName -> false;
-
-        CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild(isFeatureSupported);
+        final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(FOO_MODULE, BAR_MODULE);
+        reactor.setSupportedFeatures(ImmutableSet.of());
 
-        SchemaContext schemaContext = reactor.buildEffective();
+        final SchemaContext schemaContext = reactor.buildEffective();
         assertNotNull(schemaContext);
 
-        Module testModule = schemaContext.findModuleByName("foo", null);
+        final Module testModule = schemaContext.findModules("foo").iterator().next();
         assertNotNull(testModule);
 
         assertEquals(6, testModule.getChildNodes().size());
 
-        ContainerSchemaNode testContainerE = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerE = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-e"));
         assertNotNull(testContainerE);
-        ContainerSchemaNode testSubContainerE = (ContainerSchemaNode) testContainerE.getDataChildByName(
+        final ContainerSchemaNode testSubContainerE = (ContainerSchemaNode) testContainerE.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-subcontainer-e"));
         assertNotNull(testSubContainerE);
-        LeafSchemaNode testLeafE = (LeafSchemaNode) testSubContainerE.getDataChildByName(
+        final LeafSchemaNode testLeafE = (LeafSchemaNode) testSubContainerE.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-e"));
         assertNull(testLeafE);
 
-        ContainerSchemaNode testContainerF = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerF = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-f"));
         assertNotNull(testContainerF);
-        ContainerSchemaNode testSubContainerF = (ContainerSchemaNode) testContainerF.getDataChildByName(
+        final ContainerSchemaNode testSubContainerF = (ContainerSchemaNode) testContainerF.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-subcontainer-f"));
         assertNull(testSubContainerF);
 
-        ContainerSchemaNode testContainerG = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerG = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-g"));
         assertNotNull(testContainerG);
         assertEquals(1, testContainerG.getAvailableAugmentations().size());
-        LeafSchemaNode testLeafG = (LeafSchemaNode) testContainerG.getDataChildByName(
+        final LeafSchemaNode testLeafG = (LeafSchemaNode) testContainerG.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-leaf-g"));
         assertNotNull(testLeafG);
-        LeafSchemaNode augmentingTestLeafG = (LeafSchemaNode) testContainerG.getDataChildByName(
+        final LeafSchemaNode augmentingTestLeafG = (LeafSchemaNode) testContainerG.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "augmenting-test-leaf-g"));
         assertNull(augmentingTestLeafG);
-        AnyXmlSchemaNode augmentingTestAnyxmlG = (AnyXmlSchemaNode) testContainerG.getDataChildByName(
+        final AnyXmlSchemaNode augmentingTestAnyxmlG = (AnyXmlSchemaNode) testContainerG.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "augmenting-test-anyxml-g"));
         assertNotNull(augmentingTestAnyxmlG);
 
-        ContainerSchemaNode testContainerH = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerH = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-h"));
         assertNotNull(testContainerH);
         assertEquals(0, testContainerH.getChildNodes().size());
         assertEquals(0, testContainerH.getUses().size());
 
-        ContainerSchemaNode testContainerI = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerI = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-i"));
         assertNotNull(testContainerI);
         assertEquals(1, testContainerI.getUses().size());
@@ -341,7 +332,7 @@ public class IfFeatureResolutionTest {
                 QName.create(testModule.getQNameModule(), "test-grouping-leaf"));
         assertNull(testGroupingLeaf);
 
-        ContainerSchemaNode testContainerK = (ContainerSchemaNode) testModule.getDataChildByName(
+        final ContainerSchemaNode testContainerK = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container-k"));
         assertNotNull(testContainerK);
         assertEquals(1, testContainerK.getUses().size());
@@ -349,10 +340,10 @@ public class IfFeatureResolutionTest {
                 QName.create(testModule.getQNameModule(), "test-grouping-subcontainer"));
         assertNotNull(testGroupingSubContainer);
         assertEquals(1, testGroupingSubContainer.getAvailableAugmentations().size());
-        LeafSchemaNode augmentingTestGroupingLeaf = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
+        final LeafSchemaNode augmentingTestGroupingLeaf = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "augmenting-test-grouping-leaf"));
         assertNull(augmentingTestGroupingLeaf);
-        LeafSchemaNode augmentingTestGroupingLeaf2 = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
+        final LeafSchemaNode augmentingTestGroupingLeaf2 = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "augmenting-test-grouping-leaf-2"));
         assertNull(augmentingTestGroupingLeaf2);
         testGroupingLeaf = (LeafSchemaNode) testGroupingSubContainer.getDataChildByName(