- You have put the entire get()
get()and put()put()methods inside a shared lock. Two threads cannot use this LRU cache in parallel. - You can use define DDLNode
DDLNodeas a record. Then its instances will be immutable and its members will be public by default.