@Test
public void failWritingUInt16NotInRange() throws IOException {

    try {
        int uint = (int) Math.pow(2, 16);
        writer.writeUInt16(uint);
        fail();
    } catch (IllegalArgumentException ignored) {
    }
    try {
        int uint = -1;
        writer.writeUInt16(uint);
        fail();
    } catch (IllegalArgumentException ignored) {
    }
}