コード例 #1
0
  /** floorEntry returns preceding entry. */
  public void testDescendingFloorEntry() {
    ConcurrentNavigableMap map = dmap5();
    Map.Entry e1 = map.floorEntry(m3);
    assertEquals(m3, e1.getKey());

    Map.Entry e2 = map.floorEntry(m6);
    assertEquals(m5, e2.getKey());

    Map.Entry e3 = map.floorEntry(m1);
    assertEquals(m1, e3.getKey());

    Map.Entry e4 = map.floorEntry(zero);
    assertNull(e4);
  }
コード例 #2
0
  /** floorEntry returns preceding entry. */
  public void testFloorEntry() {
    ConcurrentNavigableMap map = map5();
    Map.Entry e1 = map.floorEntry(three);
    assertEquals(three, e1.getKey());

    Map.Entry e2 = map.floorEntry(six);
    assertEquals(five, e2.getKey());

    Map.Entry e3 = map.floorEntry(one);
    assertEquals(one, e3.getKey());

    Map.Entry e4 = map.floorEntry(zero);
    assertNull(e4);
  }