private static void writeCompilerOutput(final IonWriter writer,
                                          final WriteContext context,
                                          final IdeaCompilerOutput ideaCompilerOutput)
    throws IOException {
    writer.setFieldName("compilerOutput");
    if (ideaCompilerOutput == null) {
      writer.writeNull();
      return;
    }
    context.ideaCompilerOutputCollector.add(ideaCompilerOutput, 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) {
          writeBoolean(writer, "inheritOutputDirs", ideaCompilerOutput.getInheritOutputDirs());
          writeFile(writer, "outputDir", ideaCompilerOutput.getOutputDir());
          writeFile(writer, "testOutputDir", ideaCompilerOutput.getTestOutputDir());
        }
        writer.stepOut();
      }
    });
  }
private static void writeCompilerOutput(final IonWriter writer,
                                          final WriteContext context,
                                          final IdeaCompilerOutput ideaCompilerOutput)