@Test
public void writeFormattedLongTest() throws IOException {

  ByteArrayOutputStream outputStream = new ByteArrayOutputStream(16);
  BsUtil.writeFormattedLong(0x12345678, outputStream);
  BsUtil.writeFormattedLong(0x0eadbeef, outputStream);
  byte[] actual = outputStream.toByteArray();
  byte[] expected = {
    (byte) 0x78,
    (byte) 0x56,
    (byte) 0x34,
    (byte) 0x12,
    (byte) 0,
    (byte) 0,
    (byte) 0,
    (byte) 0,
    (byte) 0xef,
    (byte) 0xbe,
    (byte) 0xad,
    (byte) 0x0e,
    (byte) 0,
    (byte) 0,
    (byte) 0,
    (byte) 0
  };
  Assert.assertArrayEquals(expected, actual);
}