@Test
public void testOrderingAndMax() {

    final B2BoundedLruMap<String,Integer> map = B2BoundedLruMap.withMax(3);
    assertEquals(0, map.size());
    map.put("a", 1);
    map.put("b", 2);
    map.put("c", 3);
    checkContents(map, "a", "b", "c");
    // make sure we don't go past the bounds & that we get rid of the oldest accessed.
    map.put("d", 4);
    checkContents(map, "b", "c", "d");
    // access "b" to make it not the oldest.
    map.get("b");
    checkContents(map, "c", "d", "b");
    // add another to see what gets ditched
    map.put("e", 5);
    checkContents(map, "d", "b", "e");
}