You're asking about a property of the List
, and a decent List
implementation will maintain the order of the elements even after serialization. That's not a problem for ehcache or any other third party library.
Note that ehcache usually stores the cache data in RAM. In case it lacks enough RAM space, it may flush the data into disk (previous configuration).
So, looks like you're retrieving the list and reversing it. Note that you're working with the exact same object reference, so even if you don't store it back into ehcache, the state of the List
is still affected.
More info: