fixes very slow generation of large files

this should fix the following issue:
https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java/issues/87

in our case, generating a report for three relatively small json files was taking 30 minutes!