+ private List<InputStream> toStreamsWithoutDuplicates(List<YangSourceFromDependency> list) throws IOException {
+ ConcurrentMap<String, YangSourceFromDependency> byContent = Maps.newConcurrentMap();
+
+ for (YangSourceFromDependency yangFromDependency : list) {
+ try (InputStream dataStream = yangFromDependency.openStream()) {
+ String contents = IOUtils.toString(dataStream);
+ byContent.putIfAbsent(contents, yangFromDependency);
+ }
+
+ }
+ List<InputStream> inputs = new ArrayList<>(byContent.size());
+ for (YangSourceFromDependency entry : byContent.values()) {
+ inputs.add(entry.openStream());
+ }
+ return inputs;
+ }
+