Remove redundant modifiers
[yangtools.git] / yang / yang-data-impl / src / test / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / TestModel.java
index fe66a67c34ed6dc4af119927a8ae6b5619e23645..25e651914858f33fcdcf4dffbe50dcbc0e7cf9db 100644 (file)
@@ -17,7 +17,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
 import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
 
-public class TestModel {
+public final class TestModel {
 
     public static final QName TEST_QNAME = QName.create("urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test", "2014-03-13",
         "test");
@@ -34,15 +34,23 @@ public class TestModel {
     public static final QName TWO_QNAME = QName.create(TEST_QNAME, "two");
     public static final QName THREE_QNAME = QName.create(TEST_QNAME, "three");
 
+    private TestModel() {
+        throw new UnsupportedOperationException();
+    }
 
-    public static final InputStream getDatastoreTestInputStream() {
+    public static InputStream getDatastoreTestInputStream() {
         return TestModel.class.getResourceAsStream(DATASTORE_TEST_YANG);
     }
 
     public static SchemaContext createTestContext() {
+        return createTestContext(DATASTORE_TEST_YANG);
+    }
+
+    public static SchemaContext createTestContext(String resourcePath) {
         YangParserImpl parser = new YangParserImpl();
         try {
-            return parser.parseSources(Collections.singleton(Resources.asByteSource(TestModel.class.getResource(DATASTORE_TEST_YANG))));
+            return parser.parseSources(Collections.singleton(Resources.asByteSource(TestModel.class
+                    .getResource(resourcePath))));
         } catch (IOException | YangSyntaxErrorException e) {
             throw new IllegalStateException("Failed to create context", e);
         }