Java API: Add initial version of Java port for testapi.c
(Need more test cases to be implemented)
Fix prototype chain callback order
Use exception pointer instead of throwing Java exception