### Question:
Bitvector { public static Bitvector fromBytes(Bytes bytes, int size) { checkArgument( bytes.size() == sszSerializationLength(size), "Incorrect data size (%s) for Bitvector of size %s", bytes.size(), size); BitSet bitset = new BitSet(size); for (int i = size - 1; i >= 0; i--) { if (((bytes.get(i / 8) >>> (i % 8)) & 0x01) == 1) { bitset.set(i); } } return new Bitvector(bitset, size); } Bitvector(int size);  Bitvector(BitSet bitSet, int size);  Bitvector(Bitvector bitvector);  Bitvector(Iterable<Integer> indicesToSet, int size); List<Integer> getSetBitIndexes(); void setBit(int i); void setBits(int... indexes); void clearBit(int i); int getBitCount(); boolean getBit(int i); int getSize(); IntStream streamAllSetBits(); @SuppressWarnings("NarrowingCompoundAssignment") Bytes serialize(); static Bitvector fromBytes(Bytes bytes, int size); static int sszSerializationLength(final int size); Bitvector rightShift(int i); Bitvector copy(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void deserializationNotEnoughBytes() { assertThatThrownBy(() -> Bitvector.fromBytes(Bytes.of(1, 2, 3), 50)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("Incorrect data size"); }
@Test public void deserializationTooManyBytes() { assertThatThrownBy(() -> Bitvector.fromBytes(Bytes.of(1, 2, 3), 1)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("Incorrect data size"); }