@Test
public void testWriteInt() throws IOException {

  final int value = randomUUID().hashCode();
  final ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
  final LittleEndianDataOutputStream littleEndianOut = new LittleEndianDataOutputStream(byteOut);
  littleEndianOut.writeInt(value);
  littleEndianOut.close();
  final byte[] expected =
      ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(value).array();
  assertTrue(Arrays.equals(expected, byteOut.toByteArray()));
}