code: public static void serialize(@Nonnull  Writer out, @Nonnull  JsonElement json, boolean pretty) throws IOException {
          BufferedWriter bw = new BufferedWriter(out);
          serialize(bw, json, pretty, 0);
          if(pretty) {
              bw.write('\n');
          }
          bw.flush();
      }
docs: Writes the object out as json.
  
  @param out
  output writer
  @param json
  a {@link JsonElement}
  @param pretty
  if true, a properly indented version of the json is written
  @throws IOException
  if there is a problem writing to the writer