@Test
public void testPrintGotoFormWritesValidXML() throws IOException,
       ParserConfigurationException, SAXException {

  JspWriter mockJspWriter = mock(JspWriter.class);
  ArgumentCaptor<String> arg = ArgumentCaptor.forClass(String.class);
  doAnswer(new Answer<Object>() {
    @Override
    public Object answer(InvocationOnMock invok) {
      Object[] args = invok.getArguments();
      jspWriterOutput += (String) args[0];
      return null;
    }
  }).when(mockJspWriter).print(arg.capture());
  jspWriterOutput = "";
  JspHelper.printGotoForm(mockJspWriter, 424242, "a token string",
          "foobar/file", "0.0.0.0");
  DocumentBuilder parser =
      DocumentBuilderFactory.newInstance().newDocumentBuilder();
  InputSource is = new InputSource();
  is.setCharacterStream(new StringReader(jspWriterOutput));
  parser.parse(is);
}