@Test
public void testWriteInt() throws Exception {

    //given
    final int i0 = 0x45678901;
    final int i1 = 0x12345678;
    //when
    final Pointer<Integer> integerPointer = Pointer.nref(i0,
                                                         i1);
    //then
    assertThat(JNITestUtil.getByte(integerPointer.address)).isEqualTo((byte) 0x01);
    assertThat(JNITestUtil.getByte(integerPointer.address + 1)).isEqualTo((byte) 0x89);
    assertThat(JNITestUtil.getByte(integerPointer.address + 2)).isEqualTo((byte) 0x67);
    assertThat(JNITestUtil.getByte(integerPointer.address + 3)).isEqualTo((byte) 0x45);
    assertThat(JNITestUtil.getByte(integerPointer.address + 4)).isEqualTo((byte) 0x78);
    assertThat(JNITestUtil.getByte(integerPointer.address + 5)).isEqualTo((byte) 0x56);
    assertThat(JNITestUtil.getByte(integerPointer.address + 6)).isEqualTo((byte) 0x34);
    assertThat(JNITestUtil.getByte(integerPointer.address + 7)).isEqualTo((byte) 0x12);
}