Add tests for the Java implementation.