@Test
public void testWriteDouble() throws IOException {

  final double value = 256d;
  final ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
  final LittleEndianDataOutputStream littleEndianOut = new LittleEndianDataOutputStream(byteOut);
  littleEndianOut.writeDouble(value);
  littleEndianOut.close();
  final byte[] expected =
      ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putDouble(value).array();
  assertTrue(Arrays.equals(expected, byteOut.toByteArray()));
}