private static void writeRepositoryModel(final IonWriter writer,
                                           final WriteContext context,
                                           final MavenRepositoryModel repositoryModel) throws IOException {
    context.repositoryCollector.add(repositoryModel, 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", repositoryModel.getName());
          writeString(writer, "url", repositoryModel.getUrl());
        }
        writer.stepOut();
      }
    });
  }
private static void writeRepositoryModel(final IonWriter writer,
                                           final WriteContext context,
                                           final MavenRepositoryModel repositoryModel)