boolean (@NotNull Collection<ExternalDependency> dependencies1, @NotNull Collection<ExternalDependency> dependencies2) { final DependenciesIterator iterator1 = new DependenciesIterator(dependencies1); final DependenciesIterator iterator2 = new DependenciesIterator(dependencies2); return GradleContainerUtil.match(iterator1, iterator2, new BooleanBiFunction<AbstractExternalDependency, AbstractExternalDependency>() { @Override public Boolean fun(AbstractExternalDependency o1, AbstractExternalDependency o2) { if (!Objects.equal(iterator1.myProcessedStructure, iterator2.myProcessedStructure)) return false; return Objects.equal(o1.myId, o2.myId) && Objects.equal(o1.myScope, o2.myScope); } }); }