File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
src/test/java/com/crossoverjie/actual Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,37 @@ public void put2() throws Exception {
3939 System .out .println (lruMap .toString ());
4040 }
4141
42+ @ Test
43+ public void put3 () throws Exception {
44+ LRUMap <String ,Integer > lruMap = new LRUMap (4 ) ;
45+ lruMap .put ("1" ,1 ) ;
46+ lruMap .put ("2" ,2 ) ;
47+ lruMap .put ("3" ,3 ) ;
48+ lruMap .put ("2" ,2 ) ;
49+
50+ System .out .println (lruMap .toString ());
51+
52+ lruMap .put ("4" ,4 ) ;
53+ System .out .println (lruMap .toString ());
54+
55+ lruMap .put ("5" ,5 ) ;
56+ System .out .println (lruMap .toString ());
57+ }
58+
59+ @ Test
60+ public void put4 () throws Exception {
61+ LRUMap <String ,Integer > lruMap = new LRUMap (3 ) ;
62+ lruMap .put ("1" ,1 ) ;
63+ lruMap .put ("2" ,2 ) ;
64+ lruMap .put ("3" ,3 ) ;
65+
66+ System .out .println (lruMap .toString ());
67+ lruMap .put ("2" ,2 ) ;
68+
69+ System .out .println (lruMap .toString ());
70+
71+ }
72+
4273 @ Test
4374 public void get () throws Exception {
4475 LRUMap <String ,Integer > lruMap = new LRUMap (3 ) ;
You can’t perform that action at this time.
0 commit comments