boolean (@Nullable String groupId1, @Nullable String artifactId1, @Nullable String groupId2, @Nullable String artifactId2) { if (artifactId1 == null) return false; if (!artifactId1.equals(artifactId2)) return false; if (groupId1 != null) { for (String group : DEFAULT_GROUPS) { if (groupId1.equals(group)) { groupId1 = null; break; } } } if (groupId2 != null) { for (String group : DEFAULT_GROUPS) { if (groupId2.equals(group)) { groupId2 = null; break; } } } return Objects.equals(groupId1, groupId2); }