docs: public static void write( String content,
                                Writer writer ) throws IOException {
          CheckArg.isNotNull(writer, "destination writer");
          boolean error = false;
          try {
              if (content != null) {
                  writer.write(content);
              }
          } catch (IOException e) {
              error = true; // this error should be thrown, even if there is an error flushing/closing writer
              throw e;
          } catch (RuntimeException e) {
              error = true; // this error should be thrown, even if there is an error flushing/closing writer
              throw e;
          } finally {
              try {
                  writer.flush();
              } catch (IOException e) {
                  if (!error) throw e;
              } finally {
                  try {
                      writer.close();
                  } catch (IOException e) {
                      if (!error) throw e;
                  }
              }
          }
      }