class BitSetUtils {

  public static boolean[] toArray(BitSet bitset, int length) {
    if (length < 0) {
      throw new IllegalArgumentException("Size of array must not be negative but was + " + length);
    }
    boolean[] array = new boolean[length];
    for (int i = 0; i < length; i++) {
      array[i] = bitset.get(i);
    }
    return array;
  }

  private  BitSetUtils();

}