fixing Java7 file modification test

I tried to take a look at the failing test and didin't get very far. @dchambers you're probably best placed to take a look at this at some point