Fix bug in test code

Probably caused by changes in the Java API