@Test
  public void testRemoveAllFromLookupContainer() {
    addFromArray(this.set, asArray(0, 1, 2, 3, 4));

    // test against concrete HashSet
    final KTypeHashSet<KType> set2 = new KTypeHashSet<KType>();
    set2.add(asArray(1, 3, 5));

    Assert.assertEquals(2, this.set.removeAll(set2));

    Assert.assertEquals(3, this.set.size());
    TestUtils.assertSortedListEquals(this.set.toArray(), 0, 2, 4);
  }
Beispiel #2
0
 /** Create a set from a variable number of arguments or an array of <code>KType</code>. */
 public static <KType> KTypeHashSet<KType> from(final KType... elements) {
   final KTypeHashSet<KType> set = new KTypeHashSet<KType>(elements.length);
   set.add(elements);
   return set;
 }