Attaching a fix, including a test case in VirtualFileTest.
The patch simply makes close() stop nulling out the fields so that it won't run into a NPE on subsequent executions.
(I preferred that approach to adding extra null checks in close(), as it allows the code to be slightly shorter/simpler. The advantage of nulling the fields and adding extra checks would be that the objects references by the fields would be eligible for gc earlier if the VirtualRandomAccessFile instance itself was still referenced after close(). I believe that this is not the case in normal use of VRAF. And even if it is used that way, there's not much to gain since the big data structures (the byte arrays) in those instances are already freed. So adding extra code to optimize for that case didn't seem worthwhile.)
I also used the opportunity to fix a typo in VirtualFile and make some of the fields in VirtualRandomAccessFile final.
All the regression tests ran cleanly with the patch.