private static void print(Writer writer, Object o) {
    try {
      writer.append(String.valueOf(o)).append("\n");
    }
    catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
private static void print(Writer writer, Object o)