@Test
public void toIntArray() {

    IntSet hashSet = ImmutableIntSet.wrap(new HashSet<>(Arrays.asList(2)));
    int[] fromHash = hashSet.toIntArray();
    assertThat(fromHash.length, is(1));
    assertThat(fromHash[0], is(2));
    IntSet bitSet = ImmutableIntSet.wrap(new BitSetIntSet(2, Arrays.asList(2)));
    int[] fromBit = bitSet.toIntArray();
    assertThat(fromBit.length, is(1));
    assertThat(fromBit[0], is(2));
}