I guess showing the code would be easier :)
https://github.com/danberindei/infinispan/commit/69e434ba6eca03fd6cfac9cb9f21820013701579