boolean (@NotNull Collection<? extends Wrapped> libraries, @NotNull Map<String, Wrapped> cache) { cache.clear(); for (Wrapped current : libraries) { Wrapped previous = cache.remove(current.library.getExternalName()); if (previous == null) { cache.put(current.library.getExternalName(), current); } else { mixNames(current, previous); return current.library.getExternalName().equals(previous.library.getExternalName()); // Stop processing if it's not possible to generate } } return true; }