### Question:
Length { public void writeTo(final byte[] out, final int index) { for (int i = 0; i < size; i++) { out[index + i] = getByte(size - 1 - i); } } Length(final int size); void increment(); void writeTo(final byte[] out, final int index);  }### Answer:
@Test void setBytes() throws Exception { final Length len = new Length(8); len.iValue = 0b10110011100011110000111110000011; final byte[] bs = new byte[10]; len.writeTo(bs, 1); final byte[] expected = { 0, 0, 0, 0, 0, (byte) 0b10110011, (byte) 0b10001111, (byte) 0b00001111, (byte) 0b10000011, 0 }; assertArrayEquals(expected, bs); }