The problem states:
set(key, value) - Set or insert the value if the key is not already present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item.
but this test case seems to be expecting a different answer:
I would think, based on the specification, that the second set with a key of 2 would be ignored.