Clean up argument checking
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / IncludedStmtsTest.java
index e078597c8a8fdf845a9a07be613030ed74cee448..1968e1f99214ae6df85b3d79f06278b4dd421bfd 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.yangtools.yang.stmt;
 
 import static org.hamcrest.CoreMatchers.anyOf;
@@ -15,8 +14,8 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.sourceForResource;
 
+import java.util.Collection;
 import java.util.Iterator;
-import java.util.Set;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -26,6 +25,7 @@ import org.opendaylight.yangtools.yang.model.api.FeatureDefinition;
 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.Submodule;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 import org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
@@ -51,10 +51,10 @@ public class IncludedStmtsTest {
         final Module testModule = result.findModules("root-module").iterator().next();
         assertNotNull(testModule);
 
-        final Set<TypeDefinition<?>> typedefs = testModule.getTypeDefinitions();
+        final Collection<? extends TypeDefinition<?>> typedefs = testModule.getTypeDefinitions();
         assertEquals(2, typedefs.size());
 
-        final Iterator<TypeDefinition<?>> typedefsIterator = typedefs.iterator();
+        final Iterator<? extends TypeDefinition<?>> typedefsIterator = typedefs.iterator();
         TypeDefinition<?> typedef = typedefsIterator.next();
         assertThat(typedef.getQName().getLocalName(), anyOf(is("new-string-type"), is("new-int32-type")));
         assertThat(typedef.getBaseType().getQName().getLocalName(), anyOf(is("string"), is("int32")));
@@ -68,10 +68,10 @@ public class IncludedStmtsTest {
         final Module testModule = result.findModules("root-module").iterator().next();
         assertNotNull(testModule);
 
-        final Set<FeatureDefinition> features = testModule.getFeatures();
+        final Collection<? extends FeatureDefinition> features = testModule.getFeatures();
         assertEquals(2, features.size());
 
-        final Iterator<FeatureDefinition> featuresIterator = features.iterator();
+        final Iterator<? extends FeatureDefinition> featuresIterator = features.iterator();
         FeatureDefinition feature = featuresIterator.next();
         assertThat(feature.getQName().getLocalName(), anyOf(is("new-feature1"), is("new-feature2")));
         feature = featuresIterator.next();
@@ -103,7 +103,7 @@ public class IncludedStmtsTest {
         final Module testModule = result.findModules("root-module").iterator().next();
         assertNotNull(testModule);
 
-        final Module subModule = testModule.getSubmodules().iterator().next();
+        final Submodule subModule = testModule.getSubmodules().iterator().next();
         assertEquals("urn:opendaylight.org/root-module", subModule.getNamespace().toString());
     }
 }