public static List<MavenArtifactNode> convertDependencyNodes(MavenArtifactNode parent,
                                                               Collection<? extends DependencyNode> nodes,
                                                               Map<Artifact, MavenArtifact> nativeToConvertedMap,
                                                               File localRepository) {
    List<MavenArtifactNode> result = new ArrayList<MavenArtifactNode>(nodes.size());
    for (DependencyNode each : nodes) {
      Artifact a = each.getArtifact();
      MavenArtifact ma = convertArtifact(a, nativeToConvertedMap, localRepository);

      MavenArtifactState state = MavenArtifactState.ADDED;
      switch (each.getState()) {
        case DependencyNode.INCLUDED:
          break;
        case DependencyNode.OMITTED_FOR_CONFLICT:
          state = MavenArtifactState.CONFLICT;
          break;
        case DependencyNode.OMITTED_FOR_DUPLICATE:
          state = MavenArtifactState.DUPLICATE;
          break;
        case DependencyNode.OMITTED_FOR_CYCLE:
          state = MavenArtifactState.CYCLE;
          break;
        default:
          assert false : "unknown dependency node state: " + each.getState();
      }
      MavenArtifact relatedMA = each.getRelatedArtifact() == null ? null
                                                                  : convertArtifact(each.getRelatedArtifact(), nativeToConvertedMap,
                                                                                    localRepository);
      MavenArtifactNode newNode = new MavenArtifactNode(parent, ma, state, relatedMA, each.getOriginalScope(),
                                                        each.getPremanagedVersion(), each.getPremanagedScope());
      newNode.setDependencies(convertDependencyNodes(newNode, each.getChildren(), nativeToConvertedMap, localRepository));
      result.add(newNode);
    }
    return result;
  }
public static List<MavenArtifactNode> convertDependencyNodes(MavenArtifactNode parent,
                                                               Collection<? extends DependencyNode> nodes,
                                                               Map<Artifact, MavenArtifact> nativeToConvertedMap,
                                                               File localRepository)