BitSetUtils { public static BitSet copy(BitSet b) { return (BitSet) b.clone(); } private  BitSetUtils(); static BitSet copy(BitSet b); static BitSet getRandomBits(int n, Random random); static String toString(BitSet bits, int n); static String toString(BitSet bits); static boolean innerProduct(BitSet a, BitSet b); static BitSet fromList(List<Boolean> list); static BitSet fromArray(boolean[] array); static boolean[] toArray(BitSet bitset, int length); static List<Boolean> toList(BitSet bitset, int n);  }
@Test public void testCopy() { BitSet x = BitSet.valueOf(new long[] { 0L }); Assert.assertEquals(x, BitSetUtils.copy(x)); BitSet y = BitSet.valueOf(new long[] { 12034L }); Assert.assertEquals(y, BitSetUtils.copy(y)); BitSet z = BitSet.valueOf(new long[] { -12034L }); Assert.assertEquals(z, BitSetUtils.copy(z)); BitSet w = BitSet.valueOf(new long[] { 1L }); BitSet copy = BitSetUtils.copy(w); w.set(1); Assert.assertNotEquals(w, copy); }