TreeMap Test Program #1 -- WITH EXTRA DEBUG OUTPUT -- test put(): after putting 42, map = {42=boo42}, size = 1 +----------------------------------------------------------- |42=boo42, height=1 +----------------------------------------------------------- after putting 29, map = {29=boo29, 42=boo42}, size = 2 +----------------------------------------------------------- |42=boo42, height=2 | 29=boo29, height=1 +----------------------------------------------------------- after putting 42, map = {29=boo29, 42=boo42}, size = 2 +----------------------------------------------------------- |42=boo42, height=2 | 29=boo29, height=1 +----------------------------------------------------------- after putting 17, map = {17=boo17, 29=boo29, 42=boo42}, size = 3 +----------------------------------------------------------- | 42=boo42, height=1 |29=boo29, height=2 | 17=boo17, height=1 +----------------------------------------------------------- after putting 112, map = {17=boo17, 29=boo29, 42=boo42, 112=boo112}, size = 4 +----------------------------------------------------------- | 112=boo112, height=1 | 42=boo42, height=2 |29=boo29, height=3 | 17=boo17, height=1 +----------------------------------------------------------- after putting -9, map = {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 112=boo112}, size = 5 +----------------------------------------------------------- | 112=boo112, height=1 | 42=boo42, height=2 |29=boo29, height=3 | 17=boo17, height=2 | -9=boo-9, height=1 +----------------------------------------------------------- after putting 17, map = {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 112=boo112}, size = 5 +----------------------------------------------------------- | 112=boo112, height=1 | 42=boo42, height=2 |29=boo29, height=3 | 17=boo17, height=2 | -9=boo-9, height=1 +----------------------------------------------------------- after putting 82, map = {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 82=boo82, 112=boo112}, size = 6 +----------------------------------------------------------- | 112=boo112, height=1 | 82=boo82, height=2 | 42=boo42, height=1 |29=boo29, height=3 | 17=boo17, height=2 | -9=boo-9, height=1 +----------------------------------------------------------- after putting 53, map = {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112}, size = 7 +----------------------------------------------------------- | 112=boo112, height=1 | 82=boo82, height=3 | 53=boo53, height=1 | 42=boo42, height=2 |29=boo29, height=4 | 17=boo17, height=2 | -9=boo-9, height=1 +----------------------------------------------------------- test get(): {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get( 42)? boo42 {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get( 29)? boo29 {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get( 42)? boo42 {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get( 17)? boo17 {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get(112)? boo112 {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get( -9)? boo-9 {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get( 17)? boo17 {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get( 82)? boo82 {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get( 53)? boo53 {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get( 55)? null {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get(182)? null {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get(-91)? null {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get(888)? null {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get( 72)? null {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get( 33)? null {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get(999)? null {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} get(-17)? null test containsKey(): {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey( 42)? true {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey( 29)? true {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey( 42)? true {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey( 17)? true {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey(112)? true {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey( -9)? true {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey( 17)? true {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey( 82)? true {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey( 53)? true {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey( 55)? false {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey(182)? false {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey(-91)? false {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey(888)? false {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey( 72)? false {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey( 33)? false {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey(999)? false {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112} containsKey(-17)? false test remove(): after removing 55, map = {-9=boo-9, 17=boo17, 29=boo29, 42=boo42, 53=boo53, 82=boo82, 112=boo112}, size = 7, containsKey(55)? false +----------------------------------------------------------- | 112=boo112, height=1 | 82=boo82, height=3 | 53=boo53, height=1 | 42=boo42, height=2 |29=boo29, height=4 | 17=boo17, height=2 | -9=boo-9, height=1 +----------------------------------------------------------- after removing 42, map = {-9=boo-9, 17=boo17, 29=boo29, 53=boo53, 82=boo82, 112=boo112}, size = 6, containsKey(42)? false +----------------------------------------------------------- | 112=boo112, height=1 | 82=boo82, height=2 | 53=boo53, height=1 |29=boo29, height=3 | 17=boo17, height=2 | -9=boo-9, height=1 +----------------------------------------------------------- after removing 182, map = {-9=boo-9, 17=boo17, 29=boo29, 53=boo53, 82=boo82, 112=boo112}, size = 6, containsKey(182)? false +----------------------------------------------------------- | 112=boo112, height=1 | 82=boo82, height=2 | 53=boo53, height=1 |29=boo29, height=3 | 17=boo17, height=2 | -9=boo-9, height=1 +----------------------------------------------------------- after removing 17, map = {-9=boo-9, 29=boo29, 53=boo53, 82=boo82, 112=boo112}, size = 5, containsKey(17)? false +----------------------------------------------------------- | 112=boo112, height=1 | 82=boo82, height=2 | 53=boo53, height=1 |29=boo29, height=3 | -9=boo-9, height=1 +----------------------------------------------------------- after removing -91, map = {-9=boo-9, 29=boo29, 53=boo53, 82=boo82, 112=boo112}, size = 5, containsKey(-91)? false +----------------------------------------------------------- | 112=boo112, height=1 | 82=boo82, height=2 | 53=boo53, height=1 |29=boo29, height=3 | -9=boo-9, height=1 +----------------------------------------------------------- after removing 82, map = {-9=boo-9, 29=boo29, 53=boo53, 112=boo112}, size = 4, containsKey(82)? false +----------------------------------------------------------- | 112=boo112, height=2 | 53=boo53, height=1 |29=boo29, height=3 | -9=boo-9, height=1 +----------------------------------------------------------- after putting 22, map = {-9=boo-9, 22=foo, 29=boo29, 53=boo53, 112=boo112}, size = 5, containsKey(22)? true test put() with many elements: after putting 33, map = {-9=boo-9, 22=foo, 29=boo29, 33=foo33, 53=boo53, 112=boo112}, size = 6, containsKey(33)? true +----------------------------------------------------------- | 112=boo112, height=1 | 53=boo53, height=2 | 33=foo33, height=1 |29=boo29, height=3 | 22=foo, height=1 | -9=boo-9, height=2 +----------------------------------------------------------- after putting 56, map = {-9=boo-9, 22=foo, 29=boo29, 33=foo33, 53=boo53, 56=foo56, 112=boo112}, size = 7, containsKey(56)? true +----------------------------------------------------------- | 112=boo112, height=2 | 56=foo56, height=1 | 53=boo53, height=3 | 33=foo33, height=1 |29=boo29, height=4 | 22=foo, height=1 | -9=boo-9, height=2 +----------------------------------------------------------- after putting 22, map = {-9=boo-9, 22=foo22, 29=boo29, 33=foo33, 53=boo53, 56=foo56, 112=boo112}, size = 7, containsKey(22)? true +----------------------------------------------------------- | 112=boo112, height=2 | 56=foo56, height=1 | 53=boo53, height=3 | 33=foo33, height=1 |29=boo29, height=4 | 22=foo22, height=1 | -9=boo-9, height=2 +----------------------------------------------------------- after putting 19, map = {-9=boo-9, 19=foo19, 22=foo22, 29=boo29, 33=foo33, 53=boo53, 56=foo56, 112=boo112}, size = 8, containsKey(19)? true +----------------------------------------------------------- | 112=boo112, height=2 | 56=foo56, height=1 | 53=boo53, height=3 | 33=foo33, height=1 |29=boo29, height=4 | 22=foo22, height=1 | 19=foo19, height=2 | -9=boo-9, height=1 +----------------------------------------------------------- after putting 41, map = {-9=boo-9, 19=foo19, 22=foo22, 29=boo29, 33=foo33, 41=foo41, 53=boo53, 56=foo56, 112=boo112}, size = 9, containsKey(41)? true +----------------------------------------------------------- | 112=boo112, height=2 | 56=foo56, height=1 | 53=boo53, height=3 | 41=foo41, height=1 | 33=foo33, height=2 |29=boo29, height=4 | 22=foo22, height=1 | 19=foo19, height=2 | -9=boo-9, height=1 +----------------------------------------------------------- after putting 104, map = {-9=boo-9, 19=foo19, 22=foo22, 29=boo29, 33=foo33, 41=foo41, 53=boo53, 56=foo56, 104=foo104, 112=boo112}, size = 10, containsKey(104)? true +----------------------------------------------------------- | 112=boo112, height=1 | 104=foo104, height=2 | 56=foo56, height=1 | 53=boo53, height=3 | 41=foo41, height=1 | 33=foo33, height=2 |29=boo29, height=4 | 22=foo22, height=1 | 19=foo19, height=2 | -9=boo-9, height=1 +----------------------------------------------------------- after putting -2, map = {-9=boo-9, -2=foo-2, 19=foo19, 22=foo22, 29=boo29, 33=foo33, 41=foo41, 53=boo53, 56=foo56, 104=foo104, 112=boo112}, size = 11, containsKey(-2)? true +----------------------------------------------------------- | 112=boo112, height=1 | 104=foo104, height=2 | 56=foo56, height=1 | 53=boo53, height=3 | 41=foo41, height=1 | 33=foo33, height=2 |29=boo29, height=4 | 22=foo22, height=1 | 19=foo19, height=3 | -2=foo-2, height=1 | -9=boo-9, height=2 +----------------------------------------------------------- after putting 97, map = {-9=boo-9, -2=foo-2, 19=foo19, 22=foo22, 29=boo29, 33=foo33, 41=foo41, 53=boo53, 56=foo56, 97=foo97, 104=foo104, 112=boo112}, size = 12, containsKey(97)? true +----------------------------------------------------------- | 112=boo112, height=1 | 104=foo104, height=3 | 97=foo97, height=1 | 56=foo56, height=2 | 53=boo53, height=4 | 41=foo41, height=1 | 33=foo33, height=2 |29=boo29, height=5 | 22=foo22, height=1 | 19=foo19, height=3 | -2=foo-2, height=1 | -9=boo-9, height=2 +----------------------------------------------------------- after putting 97, map = {-9=boo-9, -2=foo-2, 19=foo19, 22=foo22, 29=boo29, 33=foo33, 41=foo41, 53=boo53, 56=foo56, 97=foo97, 104=foo104, 112=boo112}, size = 12, containsKey(97)? true +----------------------------------------------------------- | 112=boo112, height=1 | 104=foo104, height=3 | 97=foo97, height=1 | 56=foo56, height=2 | 53=boo53, height=4 | 41=foo41, height=1 | 33=foo33, height=2 |29=boo29, height=5 | 22=foo22, height=1 | 19=foo19, height=3 | -2=foo-2, height=1 | -9=boo-9, height=2 +----------------------------------------------------------- after putting 22, map = {-9=boo-9, -2=foo-2, 19=foo19, 22=foo22, 29=boo29, 33=foo33, 41=foo41, 53=boo53, 56=foo56, 97=foo97, 104=foo104, 112=boo112}, size = 12, containsKey(22)? true +----------------------------------------------------------- | 112=boo112, height=1 | 104=foo104, height=3 | 97=foo97, height=1 | 56=foo56, height=2 | 53=boo53, height=4 | 41=foo41, height=1 | 33=foo33, height=2 |29=boo29, height=5 | 22=foo22, height=1 | 19=foo19, height=3 | -2=foo-2, height=1 | -9=boo-9, height=2 +----------------------------------------------------------- after putting 984, map = {-9=boo-9, -2=foo-2, 19=foo19, 22=foo22, 29=boo29, 33=foo33, 41=foo41, 53=boo53, 56=foo56, 97=foo97, 104=foo104, 112=boo112, 984=foo984}, size = 13, containsKey(984)? true +----------------------------------------------------------- | 984=foo984, height=1 | 112=boo112, height=2 | 104=foo104, height=3 | 97=foo97, height=1 | 56=foo56, height=2 | 53=boo53, height=4 | 41=foo41, height=1 | 33=foo33, height=2 |29=boo29, height=5 | 22=foo22, height=1 | 19=foo19, height=3 | -2=foo-2, height=1 | -9=boo-9, height=2 +----------------------------------------------------------- after putting -797, map = {-797=foo-797, -9=boo-9, -2=foo-2, 19=foo19, 22=foo22, 29=boo29, 33=foo33, 41=foo41, 53=boo53, 56=foo56, 97=foo97, 104=foo104, 112=boo112, 984=foo984}, size = 14, containsKey(-797)? true +----------------------------------------------------------- | 984=foo984, height=1 | 112=boo112, height=2 | 104=foo104, height=3 | 97=foo97, height=1 | 56=foo56, height=2 | 53=boo53, height=4 | 41=foo41, height=1 | 33=foo33, height=2 |29=boo29, height=5 | 22=foo22, height=1 | 19=foo19, height=3 | -2=foo-2, height=1 | -9=boo-9, height=2 | -797=foo-797, height=1 +----------------------------------------------------------- after putting 66, map = {-797=foo-797, -9=boo-9, -2=foo-2, 19=foo19, 22=foo22, 29=boo29, 33=foo33, 41=foo41, 53=boo53, 56=foo56, 66=foo66, 97=foo97, 104=foo104, 112=boo112, 984=foo984}, size = 15, containsKey(66)? true +----------------------------------------------------------- | 984=foo984, height=1 | 112=boo112, height=2 | 104=foo104, height=3 | 97=foo97, height=1 | 66=foo66, height=2 | 56=foo56, height=1 | 53=boo53, height=4 | 41=foo41, height=1 | 33=foo33, height=2 |29=boo29, height=5 | 22=foo22, height=1 | 19=foo19, height=3 | -2=foo-2, height=1 | -9=boo-9, height=2 | -797=foo-797, height=1 +----------------------------------------------------------- after putting 33, map = {-797=foo-797, -9=boo-9, -2=foo-2, 19=foo19, 22=foo22, 29=boo29, 33=foo33, 41=foo41, 53=boo53, 56=foo56, 66=foo66, 97=foo97, 104=foo104, 112=boo112, 984=foo984}, size = 15, containsKey(33)? true +----------------------------------------------------------- | 984=foo984, height=1 | 112=boo112, height=2 | 104=foo104, height=3 | 97=foo97, height=1 | 66=foo66, height=2 | 56=foo56, height=1 | 53=boo53, height=4 | 41=foo41, height=1 | 33=foo33, height=2 |29=boo29, height=5 | 22=foo22, height=1 | 19=foo19, height=3 | -2=foo-2, height=1 | -9=boo-9, height=2 | -797=foo-797, height=1 +----------------------------------------------------------- after putting 90210, map = {-797=foo-797, -9=boo-9, -2=foo-2, 19=foo19, 22=foo22, 29=boo29, 33=foo33, 41=foo41, 53=boo53, 56=foo56, 66=foo66, 97=foo97, 104=foo104, 112=boo112, 984=foo984, 90210=foo90210}, size = 16, containsKey(90210)? true +----------------------------------------------------------- | 90210=foo90210, height=1 | 984=foo984, height=2 | 112=boo112, height=1 | 104=foo104, height=3 | 97=foo97, height=1 | 66=foo66, height=2 | 56=foo56, height=1 | 53=boo53, height=4 | 41=foo41, height=1 | 33=foo33, height=2 |29=boo29, height=5 | 22=foo22, height=1 | 19=foo19, height=3 | -2=foo-2, height=1 | -9=boo-9, height=2 | -797=foo-797, height=1 +----------------------------------------------------------- after putting 44444, map = {-797=foo-797, -9=boo-9, -2=foo-2, 19=foo19, 22=foo22, 29=boo29, 33=foo33, 41=foo41, 53=boo53, 56=foo56, 66=foo66, 97=foo97, 104=foo104, 112=boo112, 984=foo984, 44444=foo44444, 90210=foo90210}, size = 17, containsKey(44444)? true +----------------------------------------------------------- | 90210=foo90210, height=2 | 44444=foo44444, height=1 | 984=foo984, height=3 | 112=boo112, height=1 | 104=foo104, height=4 | 97=foo97, height=1 | 66=foo66, height=2 | 56=foo56, height=1 | 53=boo53, height=3 | 41=foo41, height=1 | 33=foo33, height=2 |29=boo29, height=5 | 22=foo22, height=1 | 19=foo19, height=3 | -2=foo-2, height=1 | -9=boo-9, height=2 | -797=foo-797, height=1 +----------------------------------------------------------- test clear(): after clear #1, map = {}, size = 0, isEmpty = true keySet() = [] after clear #2, map = {}, size = 0, isEmpty = true All tests complete.