private static void writeProjectIdentifier(final IonWriter writer,
                                             final WriteContext context,
                                             final ProjectIdentifier projectIdentifier) throws IOException {
    writer.setFieldName("projectIdentifier");
    if (projectIdentifier == null) {
      writer.writeNull();
      return;
    }
    context.projectIdentifiersCollector.add(projectIdentifier, 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, "projectPath", projectIdentifier.getProjectPath());
          writeBuildIdentifier(writer, context, projectIdentifier.getBuildIdentifier());
        }
        writer.stepOut();
      }
    });
  }
private static void writeProjectIdentifier(final IonWriter writer,
                                             final WriteContext context,
                                             final ProjectIdentifier projectIdentifier)