Added tests for Java data and fixed a stupid bug.