Java API: Make sure to delete local reference explicitly
Add ‘instanceof’ Java API integration test