BitIntegerSet implements Set<Integer>, ReversibleIterable<Integer> { @NotNull @Override public Object[] toArray() { Object[] array = new Object[cardinality()]; int i = 0; for (Integer bitIndex : this) { array[i++] = bitIndex; } return array; } BitIntegerSet();  BitIntegerSet(int i);  BitIntegerSet(@NotNull BitSet other);  BitIntegerSet(@NotNull BitIntegerSet other); private  BitIntegerSet(@NotNull BitIntegerSet other, boolean reversed); int cardinality(); int cardinality(int start); int cardinality(int start, int end); @Override boolean contains(@Nullable Object o); @NotNull @Override Object[] toArray(); @NotNull @Override T[] toArray(@NotNull T[] array); @Override boolean add(@NotNull Integer item); @NotNull int[] toArray(@Nullable int[] array); @NotNull int[] toArray(@Nullable int[] array, int destinationIndex); @Override boolean remove(@Nullable Object o); @Override boolean containsAll(@NotNull Collection<?> collection); boolean addAll(int... collection); boolean addAll(@NotNull int[] collection, int startIndex); boolean addAll(@NotNull int[] collection, int startIndex, int endIndex); @Override boolean addAll(@NotNull Collection<? extends Integer> collection); @Override boolean retainAll(@NotNull Collection<?> collection); @Override boolean removeAll(@NotNull Collection<?> collection); void forEach(@NotNull Consumer<? super Integer> consumer); void forEach(@NotNull IntConsumer consumer); @Override int size(); @Override boolean isEmpty(); @Override void clear(); static @NotNull BitIntegerSet valueOf(@NotNull long[] longs); static @NotNull BitIntegerSet valueOf(@NotNull LongBuffer buffer); static @NotNull BitIntegerSet valueOf(@NotNull byte[] bytes); static @NotNull BitIntegerSet valueOf(@NotNull ByteBuffer buffer); @NotNull byte[] toByteArray(); @NotNull long[] toLongArray(); @NotNull BitIntegerSet flip(int i); @NotNull BitIntegerSet flip(int i, int i1); @NotNull BitIntegerSet set(int i); @NotNull BitIntegerSet set(int i, boolean b); @NotNull BitIntegerSet set(int i, int i1); @NotNull BitIntegerSet set(int i, int i1, boolean b); @NotNull BitIntegerSet clear(int i); @NotNull BitIntegerSet clear(int i, int i1); @NotNull BitIntegerSet and(@NotNull BitSet set); @NotNull BitIntegerSet or(@NotNull BitSet set); @NotNull BitIntegerSet xor(@NotNull BitSet set); @NotNull BitIntegerSet andNot(@NotNull BitSet set); @NotNull BitIntegerSet and(@NotNull BitIntegerSet set); @NotNull BitIntegerSet or(@NotNull BitIntegerSet set); @NotNull BitIntegerSet xor(@NotNull BitIntegerSet set); @NotNull BitIntegerSet andNot(@NotNull BitIntegerSet set); boolean get(int i); @NotNull BitIntegerSet get(int i, int i1); int nextSetBit(int i); int nextClearBit(int i); int previousSetBit(int i); int previousClearBit(int i); boolean intersects(BitSet set); @NotNull BitSet bitSet(); @Override @NotNull ReversibleIterator<Integer> iterator(); @Override @NotNull ReversibleIterable<Integer> reversed(); @Override boolean isReversed(); @Override @NotNull ReversibleIterator<Integer> reversedIterator(); final static int[] EMPTY_INT; }
@Test public void test_toArrayNull0() { BitIntegerSet intSet = new BitIntegerSet(); int[] result = intSet.toArray((int[]) null); assertArrayEquals(EMPTY, result); }
@Test public void test_toArrayEmpty0() { BitIntegerSet intSet = new BitIntegerSet(); int[] result = intSet.toArray(EMPTY); assertEquals(EMPTY, result); }
@Test public void test_toArrayAppend0() { BitIntegerSet intSet = new BitIntegerSet(); int[] existing = { 3, 30 }; int[] result = intSet.toArray(existing, 2); assertEquals(existing, result); }