boolean (@NotNull ExternalDependency seenDependency, @NotNull ExternalDependency newDependency) { if (seenDependency instanceof ExternalProjectDependency && newDependency instanceof ExternalProjectDependency) { String seenConfiguration = ((ExternalProjectDependency)seenDependency).getConfigurationName(); String newConfiguration = ((ExternalProjectDependency)newDependency).getConfigurationName(); return seenDependency.getId().equals(newDependency.getId()) && Objects.equals(seenConfiguration, newConfiguration); } return false; }