class Bitvector {

  @SuppressWarnings("NarrowingCompoundAssignment")
  public Bytes serialize() {
    byte[] array = new byte[sszSerializationLength(size)];
    IntStream.range(0, size).forEach(i -> array[i / 8] |= ((data.get(i) ? 1 : 0) << (i % 8)));
    return Bytes.wrap(array);
  }

  public  Bitvector(int size);
  public  Bitvector(BitSet bitSet, int size);
  public  Bitvector(Bitvector bitvector);
  public  Bitvector(Iterable<Integer> indicesToSet, int size);

}