public void testSet() { // Long-long TLongHashSet llist = new TLongHashSet(); assertTrue(serializesCorrectly(llist, "set-l-1")); llist.add(0); llist.add(1); assertTrue(serializesCorrectly(llist, "set-l-2")); llist.add(Long.MIN_VALUE); assertTrue(serializesCorrectly(llist, "set-l-3")); llist.add(Long.MAX_VALUE); assertTrue(serializesCorrectly(llist, "set-l-4")); // Int-int TIntHashSet ilist = new TIntHashSet(); assertTrue(serializesCorrectly(ilist, "set-i-1")); ilist.add(0); ilist.add(1); assertTrue(serializesCorrectly(ilist, "set-i-2")); ilist.add(Integer.MIN_VALUE); assertTrue(serializesCorrectly(ilist, "set-i-3")); ilist.add(Integer.MAX_VALUE); assertTrue(serializesCorrectly(ilist, "set-i-4")); // Double-double TDoubleHashSet dlist = new TDoubleHashSet(); assertTrue(serializesCorrectly(dlist, "set-d-1")); dlist.add(0); dlist.add(1); assertTrue(serializesCorrectly(dlist, "set-d-2")); dlist.add(Double.MIN_VALUE); assertTrue(serializesCorrectly(dlist, "set-d-3")); dlist.add(Double.MAX_VALUE); assertTrue(serializesCorrectly(dlist, "set-d-4")); dlist.add(Double.POSITIVE_INFINITY); assertTrue(serializesCorrectly(dlist, "set-d-5")); dlist.add(Double.NEGATIVE_INFINITY); assertTrue(serializesCorrectly(dlist, "set-d-6")); // NOTE: trove doesn't deal well with NaN // ddmap.add( Double.NaN, Double.NaN ); // assertTrue( serializesCorrectly( ddmap ) ); // Float-float TFloatHashSet flist = new TFloatHashSet(); assertTrue(serializesCorrectly(flist, "set-f-1")); flist.add(0); flist.add(1); assertTrue(serializesCorrectly(flist, "set-f-2")); flist.add(Float.MIN_VALUE); assertTrue(serializesCorrectly(flist, "set-f-3")); flist.add(Float.MAX_VALUE); assertTrue(serializesCorrectly(flist, "set-f-4")); flist.add(Float.POSITIVE_INFINITY); assertTrue(serializesCorrectly(flist, "set-f-5")); flist.add(Float.NEGATIVE_INFINITY); assertTrue(serializesCorrectly(flist, "set-f-6")); // NOTE: trove doesn't deal well with NaN // ffmap.add( Float.NaN ); // assertTrue( serializesCorrectly( ffmap ) ); }