コード例 #1
0
 /** keySet returns a Set containing all the keys */
 public void testDescendingKeySet() {
   ConcurrentNavigableMap map = dmap5();
   Set s = map.keySet();
   assertEquals(5, s.size());
   assertTrue(s.contains(m1));
   assertTrue(s.contains(m2));
   assertTrue(s.contains(m3));
   assertTrue(s.contains(m4));
   assertTrue(s.contains(m5));
 }
コード例 #2
0
 /** keySet returns a Set containing all the keys */
 public void testKeySet() {
   ConcurrentNavigableMap map = map5();
   Set s = map.keySet();
   assertEquals(5, s.size());
   assertTrue(s.contains(one));
   assertTrue(s.contains(two));
   assertTrue(s.contains(three));
   assertTrue(s.contains(four));
   assertTrue(s.contains(five));
 }
コード例 #3
0
 /** entrySet contains all pairs */
 public void testDescendingEntrySet() {
   ConcurrentNavigableMap map = dmap5();
   Set s = map.entrySet();
   assertEquals(5, s.size());
   Iterator it = s.iterator();
   while (it.hasNext()) {
     Map.Entry e = (Map.Entry) it.next();
     assertTrue(
         (e.getKey().equals(m1) && e.getValue().equals("A"))
             || (e.getKey().equals(m2) && e.getValue().equals("B"))
             || (e.getKey().equals(m3) && e.getValue().equals("C"))
             || (e.getKey().equals(m4) && e.getValue().equals("D"))
             || (e.getKey().equals(m5) && e.getValue().equals("E")));
   }
 }
コード例 #4
0
 /** entrySet contains all pairs */
 public void testEntrySet() {
   ConcurrentNavigableMap map = map5();
   Set s = map.entrySet();
   assertEquals(5, s.size());
   Iterator it = s.iterator();
   while (it.hasNext()) {
     Map.Entry e = (Map.Entry) it.next();
     assertTrue(
         (e.getKey().equals(one) && e.getValue().equals("A"))
             || (e.getKey().equals(two) && e.getValue().equals("B"))
             || (e.getKey().equals(three) && e.getValue().equals("C"))
             || (e.getKey().equals(four) && e.getValue().equals("D"))
             || (e.getKey().equals(five) && e.getValue().equals("E")));
   }
 }