@Test public void testValueOfWithNull() { BitSet bitSet = BitSets.valueOf((int[]) null); assertEquals("{}", bitSet.toString()); assertEquals(0, bitSet.cardinality()); assertEquals(0, bitSet.length()); assertTrue(bitSet.isEmpty()); assertEquals(64, bitSet.size()); }
public static BitSet valueOf(int[] indexes) { if (indexes == null || indexes.length == 0) { return new BitSet(); } int maxIndex = Integer.MIN_VALUE; for (int index : indexes) { maxIndex = Math.max(maxIndex, index); } BitSet set = new BitSet(maxIndex); for (int index : indexes) { set.set(index); } return set; }
BitSets { public static BitSet valueOf(int[] indexes) { if (indexes == null || indexes.length == 0) { return new BitSet(); } int maxIndex = Integer.MIN_VALUE; for (int index : indexes) { maxIndex = Math.max(maxIndex, index); } BitSet set = new BitSet(maxIndex); for (int index : indexes) { set.set(index); } return set; } }
BitSets { public static BitSet valueOf(int[] indexes) { if (indexes == null || indexes.length == 0) { return new BitSet(); } int maxIndex = Integer.MIN_VALUE; for (int index : indexes) { maxIndex = Math.max(maxIndex, index); } BitSet set = new BitSet(maxIndex); for (int index : indexes) { set.set(index); } return set; }  }
BitSets { public static BitSet valueOf(int[] indexes) { if (indexes == null || indexes.length == 0) { return new BitSet(); } int maxIndex = Integer.MIN_VALUE; for (int index : indexes) { maxIndex = Math.max(maxIndex, index); } BitSet set = new BitSet(maxIndex); for (int index : indexes) { set.set(index); } return set; }  static BitSet valueOf(int[] indexes); }
BitSets { public static BitSet valueOf(int[] indexes) { if (indexes == null || indexes.length == 0) { return new BitSet(); } int maxIndex = Integer.MIN_VALUE; for (int index : indexes) { maxIndex = Math.max(maxIndex, index); } BitSet set = new BitSet(maxIndex); for (int index : indexes) { set.set(index); } return set; }  static BitSet valueOf(int[] indexes);  }