private static void writeComponentDependencies(final IonWriter writer,
                                                 final WriteContext context,
                                                 final ComponentDependencies componentDependencies) throws IOException {
    context.componentDependenciesCollector.add(componentDependencies, new ObjectCollector.Processor<IOException>() {
      @Override
      public void process(boolean isAdded, int objectId) throws IOException {
        writer.stepIn(IonType.STRUCT);
        writer.setFieldName(OBJECT_ID_FIELD);
        writer.writeInt(objectId);
        if (isAdded) {
          writeString(writer, "name", componentDependencies.getComponentName());
          writer.setFieldName("compile");
          writeDependencyNode(writer, context, componentDependencies.getCompileDependenciesGraph());
          writer.setFieldName("runtime");
          writeDependencyNode(writer, context, componentDependencies.getRuntimeDependenciesGraph());
        }
        writer.stepOut();
      }
    });
  }
private static void writeComponentDependencies(final IonWriter writer,
                                                 final WriteContext context,
                                                 final ComponentDependencies componentDependencies)