I don't think this will be very efficient, I would much rather prefer that you track whether setValue was called on the Entry instead. 

My thinking would be to extend AbstractMap.SimpleEntry with a boolean for "modified" add a method to check isModified and let setValue set modified to true. Then use the AbstractMap.SimpleEntry instead of a Map.Entry in the code above.