@Test public void testExtractFeaturePlugins() { Set<IFeaturePlugin> featurePlugins = FeaturePluginExtractor .extractFeaturePlugins(getClass().getResourceAsStream(FEATURE_TEST_XML)); assertThat(featurePlugins.size(), equalTo(1)); if (featurePlugins.size() == 1) { IFeaturePlugin featurePlugin = featurePlugins.iterator().next(); assertThat(featurePlugin.getId(), equalTo(FEATURE_ID)); assertThat(featurePlugin.getVersion(), equalTo(FEATURE_VERSION)); } }
static Set<IFeaturePlugin> extractFeaturePlugins(InputStream featureInputStream) { WorkspaceFeatureModel fmodel = new WorkspaceFeatureModel(new FileWrapper(featureInputStream)); fmodel.load(); Map<String, IFeaturePlugin> map = new HashMap<>(); Arrays.stream(fmodel.getFeature().getPlugins()).forEach(p -> map.put(p.getId(), p)); return new HashSet<>(map.values()); }
FeaturePluginExtractor { static Set<IFeaturePlugin> extractFeaturePlugins(InputStream featureInputStream) { WorkspaceFeatureModel fmodel = new WorkspaceFeatureModel(new FileWrapper(featureInputStream)); fmodel.load(); Map<String, IFeaturePlugin> map = new HashMap<>(); Arrays.stream(fmodel.getFeature().getPlugins()).forEach(p -> map.put(p.getId(), p)); return new HashSet<>(map.values()); } }
FeaturePluginExtractor { static Set<IFeaturePlugin> extractFeaturePlugins(InputStream featureInputStream) { WorkspaceFeatureModel fmodel = new WorkspaceFeatureModel(new FileWrapper(featureInputStream)); fmodel.load(); Map<String, IFeaturePlugin> map = new HashMap<>(); Arrays.stream(fmodel.getFeature().getPlugins()).forEach(p -> map.put(p.getId(), p)); return new HashSet<>(map.values()); }  }
FeaturePluginExtractor { static Set<IFeaturePlugin> extractFeaturePlugins(InputStream featureInputStream) { WorkspaceFeatureModel fmodel = new WorkspaceFeatureModel(new FileWrapper(featureInputStream)); fmodel.load(); Map<String, IFeaturePlugin> map = new HashMap<>(); Arrays.stream(fmodel.getFeature().getPlugins()).forEach(p -> map.put(p.getId(), p)); return new HashSet<>(map.values()); }   }
FeaturePluginExtractor { static Set<IFeaturePlugin> extractFeaturePlugins(InputStream featureInputStream) { WorkspaceFeatureModel fmodel = new WorkspaceFeatureModel(new FileWrapper(featureInputStream)); fmodel.load(); Map<String, IFeaturePlugin> map = new HashMap<>(); Arrays.stream(fmodel.getFeature().getPlugins()).forEach(p -> map.put(p.getId(), p)); return new HashSet<>(map.values()); }    }