code: private static String asString(Writable writable) {
          if (writable instanceof GPathResult) {
              return asString((GPathResult) writable); //GROOVY-4285
          }
          Writer sw = new StringWriter();
          try {
              writable.writeTo(sw);
          } catch (IOException e) {
              // ignore
          }
          return sw.toString();
      }
docs: TODO: replace with stream-based version