Goal: to gain practical experience in using dynamic checks in code (assertions).
Необходимо реализовать структуры данных LRUCache на хешмапе и двусвязном списке. При реализации необходимо самостоятельно продумать возможные проверки pre post-условий и инвариантов класса. Придуманные проверки необходимо добавить в код реализации в виде assertions. Класс необходимо покрыть тестами.
It is necessary to implement LRUCache
data structures on a hashmap and
double-link list. At implementation, you should think over possible checks
of pre-, post-conditions and class invariants. The invented checks should
be added as assertions in the implementation code.
The class should be covered with tests.
Instructions:
- you cannot use
LinkedHashMap
directly