Пример #1
0
  @Test
  public void testConstructorFromContainer() {
    IntOpenHashSet list2 = new IntOpenHashSet();
    list2.add(1, 3, 5);

    set = new IntDoubleLinkedSet(list2);
    assertEquals(3, set.size());
    assertSortedListEquals(list2.toArray(), set.toArray());
  }
Пример #2
0
  @Test
  public void testFromMethod() {
    IntOpenHashSet list2 = new IntOpenHashSet();
    list2.add(1, 3, 5);

    IntDoubleLinkedSet s1 = IntDoubleLinkedSet.from(1, 3, 5);
    IntDoubleLinkedSet s2 = IntDoubleLinkedSet.from(1, 3, 5);

    assertSortedListEquals(list2.toArray(), s1.toArray());
    assertSortedListEquals(list2.toArray(), s2.toArray());
  }
Пример #3
0
  @Test
  public void testRemoveAllFromLookupContainer() {
    set.add(0, 1, 2, 3, 4);

    IntOpenHashSet list2 = new IntOpenHashSet();
    list2.add(1, 3, 5);

    assertEquals(2, set.removeAll(list2));
    assertEquals(3, set.size());
    assertSortedListEquals(set.toArray(), 0, 2, 4);
  }