The lock(int recNo) method throws RecordNotFoundException because before I lock a record, I first check in the database that it exists (not marked deleted). If the record is not found, I throw RecordNotFoundException.
When I unlock a record, I just remove it from the locked records map. If the record is not on that map, I just throw an IllegalArgumentException indicating that the record is not locked.
isLocked(int recNo) just checks that the record is in the locked records map. It does not check if the record exists in the databse or not.
My problem is, for isLocked(int recNo) and unlock(int recNo) methods, when should I throw RecordNotFoundException?
The way I have implemented the two methods currently is that they do not throw the RecordNotFoundException, and I have explained why in Data class source code.
My unlock-method also doesn't throw a RNFE, my isLocked-method does. And in my opinion the isLocked should throw one, because it is a requirement (but not a must one):
Any methods that throw RecordNotFoundException should do so if a specified record does not exist or is marked as deleted in the database file.
I explained also in my choices.txt why the unlock-method (and also update and delete methods) don't throw a RNFE. So if you explained in choices.txt (which is the location where you have to explain your decisions), you'll be fine because you don't violate any must requirement.