private static void writeDependencyNode(final IonWriter writer,
                                          final WriteContext context,
                                          final DependencyNode node) throws IOException {
    if (node instanceof ProjectDependencyNode) {
      writeDependencyNode(writer, context, (ProjectDependencyNode)node);
    }
    else if (node instanceof ArtifactDependencyNode) {
      writeDependencyNode(writer, context, (ArtifactDependencyNode)node);
    }
    else if (node instanceof FileCollectionDependencyNode) {
      writeDependencyNode(writer, context, (FileCollectionDependencyNode)node);
    }
    else if (node instanceof ReferenceNode) {
      writeDependencyNode(writer, context, (ReferenceNode)node);
    }
    else if (node instanceof DependencyScopeNode) {
      writeDependencyNode(writer, context, (DependencyScopeNode)node);
    }
    else if (node instanceof UnknownDependencyNode) {
      writeDependencyNode(writer, context, (UnknownDependencyNode)node);
    }
  }
private static void writeDependencyNode(final IonWriter writer,
                                          final WriteContext context,
                                          final DependencyNode node)