void (DifferentiateContext context, Utils utils, JvmModule fromModule, boolean checkTransitive, @Nullable Predicate<Node<?, ?>> constraint) { Iterable<JvmModule> dependent = !checkTransitive? Collections.emptyList() : Iterators.recurseDepth( fromModule, mod -> Iterators.filter(Iterators.flat(Iterators.map(context.getGraph().getDependingNodes(mod.getReferenceID()), id -> utils.getNodes(id, JvmModule.class))), m -> m.requiresTransitively(mod.getName())), false ); for (JvmModule mod : Iterators.flat(Iterators.asIterable(fromModule), dependent)) { debug("Affecting modules depending on module ", mod.getName()); ModuleUsage usage = new ModuleUsage(mod.getReferenceID()); if (constraint != null) { context.affectUsage(usage, constraint); } else { context.affectUsage(usage); } } }