code: public static boolean hasDependency(List<org.apache.maven.model.Dependency> dependencies, String groupId, String artifactId) {
          if (dependencies != null) {
              for (org.apache.maven.model.Dependency dependency : dependencies) {
                  if (Objects.equal(groupId, dependency.getGroupId()) && Objects.equal(artifactId, dependency.getArtifactId())) {
                      return true;
                  }
              }
          }
          return false;
      }
docs: Returns true if the list has the given dependency