write tests for java