Fun { public static <A,B> Tuple2<A,B> t2(A a, B b) { return new Tuple2<A, B>(a,b); } private  Fun(); static final A HI(); static Tuple2<A,B> t2(A a, B b); static Tuple3<A,B,C> t3(A a, B b, C c); static Tuple4<A,B,C,D> t4(A a, B b, C c, D d); static final Object HI; }
@Test public void testSubMap(){ int nums[] = {1,2,3,4,5}; ConcurrentNavigableMap m = new ConcurrentSkipListMap(); for(int a:nums) for(int b:nums){ m.put(t2(a,b),""); } assertEquals(5, m.subMap(t2(3, null), t2(3,HI)).size()); assertEquals(3, m.subMap(t2(3, 3), t2(3,HI)).size()); assertEquals(10, m.headMap(t2(3, null)).size()); assertEquals(15, m.tailMap(t2(3, null)).size()); assertEquals(10, m.headMap(t2(2, HI)).size()); assertEquals(15, m.tailMap(t2(2, HI)).size()); }