### Question:
PathWriter { public String write(Path2D path) { StringBuilder d = new StringBuilder(); appendTo(path.getPathIterator(new AffineTransform()), d); return d.toString(); }  static String toPathData(Shape shape); String write(Path2D path); void appendTo(PathIterator it, StringBuilder d);  }### Answer:
@Test public void quadraticShortcut() throws IOException, UnableToCompleteException { Path2D path = new Path2D.Float(); path.moveTo(1792, 32); path.quadTo(1792, -34, 1745, -81); path.quadTo(1698, -128, 1632, -128); PathWriter writer = new PathWriter(); String d = writer.write(path); assertThat(d, equalTo("M1792 32q0-66-47-113t-113-47")); }