@galderz I put this methdo static because I need to know which are the keys to be locked. Should I merge it with the getAffectedKeys [1]?

if you look closer, the method are the same except in here the keys are ordered. What do you suggest?

[1] https://github.com/infinispan/infinispan/pull/1669/files#L105R626