private static void writeProject(final IonWriter writer,
                                   final WriteContext context,
                                   final IdeaProject project) throws IOException {
    context.ideaProjectsCollector.add(project, 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", project.getName());
          writeString(writer, "description", project.getDescription());
          writeString(writer, "jdkName", project.getJdkName());
          writeJavaLanguageSettings(writer, context, project.getJavaLanguageSettings());
          writeString(writer, "languageLevel", project.getLanguageLevel().getLevel());
          writeModules(writer, context, project.getModules());
        }
        writer.stepOut();
      }
    });
  }
private static void writeProject(final IonWriter writer,
                                   final WriteContext context,
                                   final IdeaProject project)