Thanks for the test case. I can see what the problem is. It is related to
The problem is that your script uses unicode escape characters and Groovy does not handle them well. The source locations for unicode escape characters are off and this screws up the entire file.
You use one escape char here:
private final static String KEY_NUMBER_REFERENCES =
"<n-snippet rank=\"1\" score=\"0.1\" beginoff=\"1\" endoff=\"2\">foo\uF230bar</n-snippet>";
If you move this line to the end of the file, then source locations only for elements after that one is screwed up. So, if you do this, then you can get your tests to run.