@Test
public void testCastpp() throws Exception {

    //given
    final byte b0 = (byte) 0x8F;
    final byte b1 = 0x7F;
    final byte b2 = (byte) 0xF7;
    final byte b3 = 0x00;
    final byte b4 = 0x01;
    final long pointer = byteArrayAsPointer(b0,
                                            b1,
                                            b2,
                                            b3,
                                            b4);
    final long pointerOfPointer        = pointerOfPointer(pointer);
    final long pointerOfPointerPointer = pointerOfPointer(pointerOfPointer);
    //when
    try (final Pointer<Pointer<Pointer<Byte>>> bytePointerPointer = wrap(Byte.class,
                                                                         pointerOfPointerPointer).castpp()
                                                                                                 .castpp();
         final Pointer<Pointer> pointerPointer = wrap(Pointer.class,
                                                      pointerOfPointer)) {
        //then
        assertThat(bytePointerPointer.get()
                                     .get()
                                     .get(4)).isEqualTo(b4);
        //throws error complaining about incomplete type
        this.expectedException.expect(IllegalStateException.class);
        this.expectedException.expectMessage("Can not dereference void pointer.");
        pointerPointer.get()
                      .get();
    }
}