In general I think we should use another pattern here, i.e. use a file utility that throws an exception on error. We are not really testing that createNewFile works here, but since there is another pattern already in place, it's better to move it to a separate commit, OR fix the mkdirs asserts too.