title: How to write unit tests for code, which uses FreeMarker templates?
body: <p>I am going to use a template engine in Java (probably <code>FreeMarker</code>). Now I wonder how to write a unit test for it.</p>
  
  <p>I can prepare an expected output as a text file but I will have to change it manually whenever I change the template. I would like to parse the output using the template to get the model data and it with the original model. Can I do that? </p>