code: public static WriteOptions writeOptions(Boolean overwrite, Boolean forceSync){
      WriteOptions wo = new WriteOptions();
      if (overwrite != null)
        wo.setOverwrite(overwrite);
      if (forceSync != null)
        wo.setForcesync(forceSync);
      return wo;
    }
docs: Creates a WriteOptions from given overwrite and forceSync values. If null passed,
  it will use their default value.