Bug 6868: If-feature argument may be boolean expression
[yangtools.git] / yang / yang-test-util / src / main / java / org / opendaylight / yangtools / yang / test / util / YangParserTestUtils.java
index 0f4e5c13664acfc2b1ec41dcc4d7cab0264871dc..2892589e8253d19f8bad4ff9c9d3fcd25b5cd521 100644 (file)
@@ -20,10 +20,9 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
-import java.util.function.Predicate;
+import java.util.Set;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.repo.api.IfFeaturePredicates;
 import org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode;
 import org.opendaylight.yangtools.yang.parser.rfc6020.repo.YinStatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
@@ -62,14 +61,14 @@ public final class YangParserTestUtils {
      */
     @Deprecated
     public static SchemaContext parseYangSources(final YangStatementSourceImpl... sources) throws ReactorException {
-        return parseYangSources(IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE, sources);
+        return parseYangSources(StatementParserMode.DEFAULT_MODE, sources);
     }
 
     /**
      * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
      * default mode.
      *
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      * @param sources YANG sources to be parsed
      *
      * @return effective schema context
@@ -78,9 +77,9 @@ public final class YangParserTestUtils {
      * @deprecated Migration method only, do not use.
      */
     @Deprecated
-    public static SchemaContext parseYangSources(final Predicate<QName> isFeatureSupported,
+    public static SchemaContext parseYangSources(final Set<QName> supportedFeatures,
             final YangStatementSourceImpl... sources) throws ReactorException {
-        return parseYangSources(isFeatureSupported, StatementParserMode.DEFAULT_MODE, sources);
+        return parseYangSources(supportedFeatures, StatementParserMode.DEFAULT_MODE, sources);
     }
 
     /**
@@ -97,13 +96,13 @@ public final class YangParserTestUtils {
     @Deprecated
     public static SchemaContext parseYangSources(final StatementParserMode statementParserMode,
             final YangStatementSourceImpl... sources) throws ReactorException {
-        return parseYangSources(IfFeaturePredicates.ALL_FEATURES, statementParserMode, sources);
+        return parseYangSources(null, statementParserMode, sources);
     }
 
     /**
      * Creates a new effective schema context containing the specified YANG sources.
      *
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      * @param statementParserMode mode of statement parser
      * @param sources YANG sources to be parsed
      *
@@ -111,11 +110,11 @@ public final class YangParserTestUtils {
      *
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      */
-    public static SchemaContext parseYangSources(final Predicate<QName> isFeatureSupported,
+    public static SchemaContext parseYangSources(final Set<QName> supportedFeatures,
             final StatementParserMode statementParserMode, final YangStatementSourceImpl... sources)
                     throws ReactorException {
         final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild(
-                statementParserMode, isFeatureSupported);
+                statementParserMode, supportedFeatures);
         reactor.addSources(sources);
 
         return reactor.buildEffective();
@@ -133,14 +132,14 @@ public final class YangParserTestUtils {
      * @throws FileNotFoundException if one of the specified files does not exist
      */
     public static SchemaContext parseYangSources(final File... files) throws ReactorException, FileNotFoundException {
-        return parseYangSources(IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE, files);
+        return parseYangSources(StatementParserMode.DEFAULT_MODE, files);
     }
 
     /**
      * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
      * default mode.
      *
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      * @param files YANG files to be parsed
      *
      * @return effective schema context
@@ -148,9 +147,9 @@ public final class YangParserTestUtils {
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      * @throws FileNotFoundException if one of the specified files does not exist
      */
-    public static SchemaContext parseYangSources(final Predicate<QName> isFeatureSupported, final File... files)
+    public static SchemaContext parseYangSources(final Set<QName> supportedFeatures, final File... files)
             throws ReactorException, FileNotFoundException {
-        return parseYangSources(isFeatureSupported, StatementParserMode.DEFAULT_MODE, files);
+        return parseYangSources(supportedFeatures, StatementParserMode.DEFAULT_MODE, files);
     }
 
     /**
@@ -166,13 +165,13 @@ public final class YangParserTestUtils {
      */
     public static SchemaContext parseYangSources(final StatementParserMode statementParserMode, final File... files)
             throws ReactorException, FileNotFoundException {
-        return parseYangSources(IfFeaturePredicates.ALL_FEATURES, statementParserMode, files);
+        return parseYangSources(null, statementParserMode, files);
     }
 
     /**
      * Creates a new effective schema context containing the specified YANG sources.
      *
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      * @param statementParserMode mode of statement parser
      * @param files YANG files to be parsed
      *
@@ -181,7 +180,7 @@ public final class YangParserTestUtils {
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      * @throws FileNotFoundException if one of the specified files does not exist
      */
-    public static SchemaContext parseYangSources(final Predicate<QName> isFeatureSupported,
+    public static SchemaContext parseYangSources(final Set<QName> supportedFeatures,
             final StatementParserMode statementParserMode, final File... files) throws ReactorException,
             FileNotFoundException {
         final YangStatementSourceImpl[] sources = new YangStatementSourceImpl[files.length];
@@ -189,7 +188,7 @@ public final class YangParserTestUtils {
             sources[i] = new YangStatementSourceImpl(new NamedFileInputStream(files[i], files[i].getPath()));
         }
 
-        return parseYangSources(isFeatureSupported, statementParserMode, sources);
+        return parseYangSources(supportedFeatures, statementParserMode, sources);
     }
 
     /**
@@ -205,14 +204,14 @@ public final class YangParserTestUtils {
      */
     public static SchemaContext parseYangSources(final Collection<File> files) throws ReactorException,
             FileNotFoundException {
-        return parseYangSources(files, IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE);
+        return parseYangSources(files, StatementParserMode.DEFAULT_MODE);
     }
 
     /**
      * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
      * default mode.
      *
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      * @param files collection of YANG files to be parsed
      *
      * @return effective schema context
@@ -220,9 +219,9 @@ public final class YangParserTestUtils {
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      * @throws FileNotFoundException if one of the specified files does not exist
      */
-    public static SchemaContext parseYangSources(final Collection<File> files, final Predicate<QName> isFeatureSupported)
+    public static SchemaContext parseYangSources(final Collection<File> files, final Set<QName> supportedFeatures)
             throws ReactorException, FileNotFoundException {
-        return parseYangSources(files, isFeatureSupported, StatementParserMode.DEFAULT_MODE);
+        return parseYangSources(files, supportedFeatures, StatementParserMode.DEFAULT_MODE);
     }
 
     /**
@@ -238,13 +237,13 @@ public final class YangParserTestUtils {
      */
     public static SchemaContext parseYangSources(final Collection<File> files, final StatementParserMode statementParserMode)
             throws ReactorException, FileNotFoundException {
-        return parseYangSources(files, IfFeaturePredicates.ALL_FEATURES, statementParserMode);
+        return parseYangSources(files, null, statementParserMode);
     }
 
     /**
      * Creates a new effective schema context containing the specified YANG sources.
      *
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      * @param statementParserMode mode of statement parser
      * @param files collection of YANG files to be parsed
      *
@@ -253,9 +252,9 @@ public final class YangParserTestUtils {
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      * @throws FileNotFoundException if one of the specified files does not exist
      */
-    public static SchemaContext parseYangSources(final Collection<File> files, final Predicate<QName> isFeatureSupported,
+    public static SchemaContext parseYangSources(final Collection<File> files, final Set<QName> supportedFeatures,
             final StatementParserMode statementParserMode) throws ReactorException, FileNotFoundException {
-        return parseYangSources(isFeatureSupported, statementParserMode, files.toArray(new File[files.size()]));
+        return parseYangSources(supportedFeatures, statementParserMode, files.toArray(new File[files.size()]));
     }
 
     /**
@@ -272,8 +271,7 @@ public final class YangParserTestUtils {
      */
     public static SchemaContext parseYangSources(final String yangSourcesDirectoryPath) throws ReactorException,
             FileNotFoundException, URISyntaxException {
-        return parseYangSources(yangSourcesDirectoryPath, IfFeaturePredicates.ALL_FEATURES,
-            StatementParserMode.DEFAULT_MODE);
+        return parseYangSources(yangSourcesDirectoryPath, StatementParserMode.DEFAULT_MODE);
     }
 
     /**
@@ -281,7 +279,7 @@ public final class YangParserTestUtils {
      * default mode.
      *
      * @param yangSourcesDirectoryPath relative path to the directory with YANG files to be parsed
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      *
      * @return effective schema context
      *
@@ -290,9 +288,9 @@ public final class YangParserTestUtils {
      * @throws URISyntaxException if the specified directory does not exist
      */
     public static SchemaContext parseYangSources(final String yangSourcesDirectoryPath,
-            final Predicate<QName> isFeatureSupported) throws ReactorException, FileNotFoundException,
+            final Set<QName> supportedFeatures) throws ReactorException, FileNotFoundException,
             URISyntaxException {
-        return parseYangSources(yangSourcesDirectoryPath, isFeatureSupported, StatementParserMode.DEFAULT_MODE);
+        return parseYangSources(yangSourcesDirectoryPath, supportedFeatures, StatementParserMode.DEFAULT_MODE);
     }
 
     /**
@@ -310,14 +308,14 @@ public final class YangParserTestUtils {
     public static SchemaContext parseYangSources(final String yangSourcesDirectoryPath,
             final StatementParserMode statementParserMode) throws ReactorException, FileNotFoundException,
             URISyntaxException {
-        return parseYangSources(yangSourcesDirectoryPath, IfFeaturePredicates.ALL_FEATURES, statementParserMode);
+        return parseYangSources(yangSourcesDirectoryPath, null, statementParserMode);
     }
 
     /**
      * Creates a new effective schema context containing the specified YANG sources.
      *
      * @param yangSourcesDirectoryPath relative path to the directory with YANG files to be parsed
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      * @param statementParserMode mode of statement parser
      *
      * @return effective schema context
@@ -327,12 +325,12 @@ public final class YangParserTestUtils {
      * @throws URISyntaxException if the specified directory does not exist
      */
     public static SchemaContext parseYangSources(final String yangSourcesDirectoryPath,
-            final Predicate<QName> isFeatureSupported, final StatementParserMode statementParserMode)
+            final Set<QName> supportedFeatures, final StatementParserMode statementParserMode)
                     throws ReactorException, FileNotFoundException, URISyntaxException {
         final URI directoryPath = YangParserTestUtils.class.getResource(yangSourcesDirectoryPath).toURI();
         final File dir = new File(directoryPath);
 
-        return parseYangSources(isFeatureSupported, statementParserMode, dir.listFiles(YANG_FILE_FILTER));
+        return parseYangSources(supportedFeatures, statementParserMode, dir.listFiles(YANG_FILE_FILTER));
     }
 
     /**
@@ -349,7 +347,7 @@ public final class YangParserTestUtils {
      */
     public static SchemaContext parseYangSource(final String yangSourcePath) throws ReactorException,
             FileNotFoundException, URISyntaxException {
-        return parseYangSource(yangSourcePath, IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE);
+        return parseYangSource(yangSourcePath, StatementParserMode.DEFAULT_MODE);
     }
 
     /**
@@ -357,7 +355,7 @@ public final class YangParserTestUtils {
      * default mode.
      *
      * @param yangSourcePath relative path to the YANG file to be parsed
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG model are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG model are resolved
      *
      * @return effective schema context
      *
@@ -365,9 +363,9 @@ public final class YangParserTestUtils {
      * @throws FileNotFoundException if the specified file does not exist
      * @throws URISyntaxException if the specified file does not exist
      */
-    public static SchemaContext parseYangSource(final String yangSourcePath, final Predicate<QName> isFeatureSupported)
+    public static SchemaContext parseYangSource(final String yangSourcePath, final Set<QName> supportedFeatures)
             throws ReactorException, FileNotFoundException, URISyntaxException {
-        return parseYangSource(yangSourcePath, isFeatureSupported, StatementParserMode.DEFAULT_MODE);
+        return parseYangSource(yangSourcePath, supportedFeatures, StatementParserMode.DEFAULT_MODE);
     }
 
     /**
@@ -384,14 +382,14 @@ public final class YangParserTestUtils {
      */
     public static SchemaContext parseYangSource(final String yangSourcePath, final StatementParserMode statementParserMode)
             throws ReactorException, FileNotFoundException, URISyntaxException {
-        return parseYangSource(yangSourcePath, IfFeaturePredicates.ALL_FEATURES, statementParserMode);
+        return parseYangSource(yangSourcePath, null, statementParserMode);
     }
 
     /**
      * Creates a new effective schema context containing the specified YANG source.
      *
      * @param yangSourcePath relative path to the YANG file to be parsed
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG model are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG model are resolved
      * @param statementParserMode mode of statement parser
      *
      * @return effective schema context
@@ -400,12 +398,12 @@ public final class YangParserTestUtils {
      * @throws FileNotFoundException if the specified file does not exist
      * @throws URISyntaxException if the specified file does not exist
      */
-    public static SchemaContext parseYangSource(final String yangSourcePath, final Predicate<QName> isFeatureSupported,
+    public static SchemaContext parseYangSource(final String yangSourcePath, final Set<QName> supportedFeatures,
             final StatementParserMode statementParserMode) throws ReactorException, FileNotFoundException,
             URISyntaxException {
         final URI sourcePath = YangParserTestUtils.class.getResource(yangSourcePath).toURI();
         final File sourceFile = new File(sourcePath);
-        return parseYangSources(isFeatureSupported, statementParserMode, sourceFile);
+        return parseYangSources(supportedFeatures, statementParserMode, sourceFile);
     }
 
     /**
@@ -423,7 +421,7 @@ public final class YangParserTestUtils {
      */
     public static SchemaContext parseYangSources(final List<String> yangDirs, final List<String> yangFiles)
             throws FileNotFoundException, ReactorException, URISyntaxException {
-        return parseYangSources(yangDirs, yangFiles, IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE);
+        return parseYangSources(yangDirs, yangFiles, StatementParserMode.DEFAULT_MODE);
     }
 
     /**
@@ -432,7 +430,7 @@ public final class YangParserTestUtils {
      *
      * @param yangDirs relative paths to the directories containing YANG files to be parsed
      * @param yangFiles relative paths to the YANG files to be parsed
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      *
      * @return effective schema context
      *
@@ -441,9 +439,9 @@ public final class YangParserTestUtils {
      * @throws URISyntaxException if one of the specified directories or files does not exist
      */
     public static SchemaContext parseYangSources(final List<String> yangDirs, final List<String> yangFiles,
-            final Predicate<QName> isFeatureSupported) throws FileNotFoundException, ReactorException,
+            final Set<QName> supportedFeatures) throws FileNotFoundException, ReactorException,
             URISyntaxException {
-        return parseYangSources(yangDirs, yangFiles, isFeatureSupported, StatementParserMode.DEFAULT_MODE);
+        return parseYangSources(yangDirs, yangFiles, supportedFeatures, StatementParserMode.DEFAULT_MODE);
     }
 
     /**
@@ -462,7 +460,7 @@ public final class YangParserTestUtils {
     public static SchemaContext parseYangSources(final List<String> yangDirs, final List<String> yangFiles,
             final StatementParserMode statementParserMode) throws FileNotFoundException, ReactorException,
             URISyntaxException {
-        return parseYangSources(yangDirs, yangFiles, IfFeaturePredicates.ALL_FEATURES, statementParserMode);
+        return parseYangSources(yangDirs, yangFiles, null, statementParserMode);
     }
 
     /**
@@ -470,7 +468,7 @@ public final class YangParserTestUtils {
      *
      * @param yangDirs relative paths to the directories containing YANG files to be parsed
      * @param yangFiles relative paths to the YANG files to be parsed
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      * @param statementParserMode mode of statement parser
      *
      * @return effective schema context
@@ -480,7 +478,7 @@ public final class YangParserTestUtils {
      * @throws URISyntaxException if one of the specified directories or files does not exist
      */
     public static SchemaContext parseYangSources(final List<String> yangDirs, final List<String> yangFiles,
-            final Predicate<QName> isFeatureSupported, final StatementParserMode statementParserMode)
+            final Set<QName> supportedFeatures, final StatementParserMode statementParserMode)
             throws FileNotFoundException, ReactorException, URISyntaxException {
         final List<File> allYangFiles = new ArrayList<>();
         for (final String yangDir : yangDirs) {
@@ -492,7 +490,7 @@ public final class YangParserTestUtils {
             allYangFiles.add(new File(filePath));
         }
 
-        return parseYangSources(allYangFiles, isFeatureSupported, statementParserMode);
+        return parseYangSources(allYangFiles, supportedFeatures, statementParserMode);
     }
 
     private static Collection<File> getYangFiles(final String yangSourcesDirectoryPath) throws URISyntaxException {
@@ -513,23 +511,23 @@ public final class YangParserTestUtils {
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      */
     public static SchemaContext parseYangSources(final List<String> filePaths) throws ReactorException {
-        return parseYangSources(filePaths, IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE);
+        return parseYangSources(filePaths, StatementParserMode.DEFAULT_MODE);
     }
 
     /**
      * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
      * default mode.
      *
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      * @param filePaths relative paths to the YANG files to be parsed
      *
      * @return effective schema context
      *
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      */
-    public static SchemaContext parseYangSources(final List<String> filePaths, final Predicate<QName> isFeatureSupported)
+    public static SchemaContext parseYangSources(final List<String> filePaths, final Set<QName> supportedFeatures)
             throws ReactorException {
-        return parseYangSources(filePaths, isFeatureSupported, StatementParserMode.DEFAULT_MODE);
+        return parseYangSources(filePaths, supportedFeatures, StatementParserMode.DEFAULT_MODE);
     }
 
     /**
@@ -542,15 +540,15 @@ public final class YangParserTestUtils {
      *
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      */
-    public static SchemaContext parseYangSources(final List<String> filePaths,final StatementParserMode statementParserMode)
-            throws ReactorException {
-        return parseYangSources(filePaths, IfFeaturePredicates.ALL_FEATURES, statementParserMode);
+    public static SchemaContext parseYangSources(final List<String> filePaths,
+            final StatementParserMode statementParserMode) throws ReactorException {
+        return parseYangSources(filePaths, (Set<QName>) null, statementParserMode);
     }
 
     /**
      * Creates a new effective schema context containing the specified YANG sources.
      *
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      * @param statementParserMode mode of statement parser
      * @param filePaths relative paths to the YANG files to be parsed
      *
@@ -559,7 +557,7 @@ public final class YangParserTestUtils {
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      */
     public static SchemaContext parseYangSources(final List<String> filePaths,
-            final Predicate<QName> isFeatureSupported, final StatementParserMode statementParserMode)
+            final Set<QName> supportedFeatures, final StatementParserMode statementParserMode)
                     throws ReactorException {
         final YangStatementSourceImpl[] sources = new YangStatementSourceImpl[filePaths.size()];
 
@@ -567,7 +565,7 @@ public final class YangParserTestUtils {
             sources[i] = new YangStatementSourceImpl(YangParserTestUtils.class.getResourceAsStream(filePaths.get(i)));
         }
 
-        return parseYangSources(isFeatureSupported, statementParserMode, sources);
+        return parseYangSources(supportedFeatures, statementParserMode, sources);
     }
 
     /**
@@ -581,7 +579,7 @@ public final class YangParserTestUtils {
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      */
     public static SchemaContext parseYangStreams(final List<InputStream> streams) throws ReactorException {
-        return parseYangStreams(streams, IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE);
+        return parseYangStreams(streams, StatementParserMode.DEFAULT_MODE);
     }
 
     /**
@@ -589,15 +587,15 @@ public final class YangParserTestUtils {
      * default mode.
      *
      * @param streams input streams containing YANG sources to be parsed
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      *
      * @return effective schema context
      *
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      */
-    public static SchemaContext parseYangStreams(final List<InputStream> streams, final Predicate<QName> isFeatureSupported)
+    public static SchemaContext parseYangStreams(final List<InputStream> streams, final Set<QName> supportedFeatures)
             throws ReactorException {
-        return parseYangStreams(streams, isFeatureSupported, StatementParserMode.DEFAULT_MODE);
+        return parseYangStreams(streams, supportedFeatures, StatementParserMode.DEFAULT_MODE);
     }
 
     /**
@@ -612,13 +610,13 @@ public final class YangParserTestUtils {
      */
     public static SchemaContext parseYangStreams(final List<InputStream> streams, final StatementParserMode statementParserMode)
             throws ReactorException {
-        return parseYangStreams(streams, IfFeaturePredicates.ALL_FEATURES, statementParserMode);
+        return parseYangStreams(streams, null, statementParserMode);
     }
 
     /**
      * Creates a new effective schema context containing the specified YANG sources.
      *
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      * @param statementParserMode mode of statement parser
      * @param streams input streams containing YANG sources to be parsed
      *
@@ -626,10 +624,10 @@ public final class YangParserTestUtils {
      *
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      */
-    public static SchemaContext parseYangStreams(final List<InputStream> streams, final Predicate<QName> isFeatureSupported,
+    public static SchemaContext parseYangStreams(final List<InputStream> streams, final Set<QName> supportedFeatures,
             final StatementParserMode statementParserMode) throws ReactorException {
         final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild(
-                statementParserMode, isFeatureSupported);
+                statementParserMode, supportedFeatures);
         return reactor.buildEffective(streams);
     }
 
@@ -647,7 +645,7 @@ public final class YangParserTestUtils {
     public static SchemaContext parseYangResources(final Class<?> clazz, final String... resources)
             throws ReactorException {
         final List<InputStream> streams = new ArrayList<>(resources.length);
-        for (String r : resources) {
+        for (final String r : resources) {
             final InputStream is = clazz.getResourceAsStream(r);
             Preconditions.checkArgument(is != null, "Resource %s not found", r);
             streams.add(is);
@@ -674,16 +672,16 @@ public final class YangParserTestUtils {
      * Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
      * default mode.
      *
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      * @param streams input streams containing YANG sources to be parsed
      *
      * @return effective schema context
      *
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      */
-    public static SchemaContext parseYangStreams(final Predicate<QName> isFeatureSupported,
+    public static SchemaContext parseYangStreams(final Set<QName> supportedFeatures,
             final InputStream... streams) throws ReactorException {
-        return parseYangStreams(Arrays.asList(streams), isFeatureSupported);
+        return parseYangStreams(Arrays.asList(streams), supportedFeatures);
     }
 
     /**
@@ -704,7 +702,7 @@ public final class YangParserTestUtils {
     /**
      * Creates a new effective schema context containing the specified YANG sources.
      *
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
      * @param statementParserMode mode of statement parser
      * @param streams input streams containing YANG sources to be parsed
      *
@@ -712,9 +710,9 @@ public final class YangParserTestUtils {
      *
      * @throws ReactorException if there is an error in one of the parsed YANG sources
      */
-    public static SchemaContext parseYangStreams(final Predicate<QName> isFeatureSupported,
+    public static SchemaContext parseYangStreams(final Set<QName> supportedFeatures,
             final StatementParserMode statementParserMode, final InputStream... streams) throws ReactorException {
-        return parseYangStreams(Arrays.asList(streams), isFeatureSupported, statementParserMode);
+        return parseYangStreams(Arrays.asList(streams), supportedFeatures, statementParserMode);
     }
 
     /**
@@ -728,22 +726,22 @@ public final class YangParserTestUtils {
      * @throws ReactorException if there is an error in one of the parsed YIN sources
      */
     public static SchemaContext parseYinSources(final YinStatementStreamSource... sources) throws ReactorException {
-        return parseYinSources(IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE, sources);
+        return parseYinSources(StatementParserMode.DEFAULT_MODE, sources);
     }
 
     /**
      * Creates a new effective schema context containing the specified YIN sources. Statement parser mode is set to
      * default mode.
      *
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YIN models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YIN models are resolved
      * @param sources YIN sources to be parsed
      *
      * @return effective schema context
      * @throws ReactorException if there is an error in one of the parsed YIN sources
      */
-    public static SchemaContext parseYinSources(final Predicate<QName> isFeatureSupported,
+    public static SchemaContext parseYinSources(final Set<QName> supportedFeatures,
             final YinStatementStreamSource... sources) throws ReactorException {
-        return parseYinSources(isFeatureSupported, StatementParserMode.DEFAULT_MODE, sources);
+        return parseYinSources(supportedFeatures, StatementParserMode.DEFAULT_MODE, sources);
     }
 
     /**
@@ -758,13 +756,13 @@ public final class YangParserTestUtils {
      */
     public static SchemaContext parseYinSources(final StatementParserMode statementParserMode,
             final YinStatementStreamSource... sources) throws ReactorException {
-        return parseYinSources(IfFeaturePredicates.ALL_FEATURES, statementParserMode, sources);
+        return parseYinSources(null, statementParserMode, sources);
     }
 
     /**
      * Creates a new effective schema context containing the specified YIN sources.
      *
-     * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YIN models are resolved
+     * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YIN models are resolved
      * @param statementParserMode mode of statement parser
      * @param sources YIN sources to be parsed
      *
@@ -772,11 +770,11 @@ public final class YangParserTestUtils {
      *
      * @throws ReactorException if there is an error in one of the parsed YIN sources
      */
-    public static SchemaContext parseYinSources(final Predicate<QName> isFeatureSupported,
+    public static SchemaContext parseYinSources(final Set<QName> supportedFeatures,
             final StatementParserMode statementParserMode, final YinStatementStreamSource... sources)
                     throws ReactorException {
         final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild(
-                statementParserMode, isFeatureSupported);
+                statementParserMode, supportedFeatures);
         reactor.addSources(sources);
 
         return reactor.buildEffective();