// Allocate and initialize some memory on the heap.
long ptr = malloc(bar.SIZEOF);
memset(ptr, 0, bar.SIZEOF);
// Configure an object that can be mapped to a C structure.
bar expected = new bar();
expected.a = 35;
expected.b = Integer.MAX_VALUE;
System.arraycopy("Hello World!".getBytes(), 0, expected.c, 0, 5);
// Marshal the object to the allocated heap memory
memmove(ptr, expected, bar.SIZEOF);
// Unmarshal the object from the allocated heap memory.
bar acutal = new bar();
memmove(acutal, ptr, bar.SIZEOF);
assertEquals(expected, acutal);
Callback callback = new Callback(this, "instanceCallback", 1);