mark-christiaens/xtext — comment on commit 40a6567f46e9dbb470d0ed3110ddf4a34d3ac586
File: tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/modelcache/LRUReplacementStrategyTest.java line 63
By mark-christiaens:

You're right. The test is messed up (I've been cleaning up the asserts and this is a side effect). I think I'm going to demand that no entry gets added twice. I'll change the test to do index.get(entries.get(0).getDigest()). That should update the index' statistics so that the first entry is the most recently used. Then, asking the LRUReplacementStrategy to select replacementcandidates will select the 1st and 2nd entry (since those are the oldest and those two reduce the size of the cache to MAXSIZE-1 leaving room for the new entry).