예제 #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());
  }